aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--root/html/pages/distrib/index.tt14
1 files changed, 10 insertions, 4 deletions
diff --git a/root/html/pages/distrib/index.tt b/root/html/pages/distrib/index.tt
index 9102db0..5ce85ea 100644
--- a/root/html/pages/distrib/index.tt
+++ b/root/html/pages/distrib/index.tt
@@ -1,21 +1,27 @@
<!-- $Id$ -->
<form id="distform" action="[% c.uri_for() %]">
-[% FOREACH ver = c.model('Mirrors').version_list.keys.sort %]
+[% SET versions = c.model('Mirrors').version_list.keys.sort %]
+[% SET selver = c.req.param('version') %]
+[% DEFAULT selver = versions.-1 %]
+[% FOREACH ver = versions %]
[% IF loop.first %]
<select name="version">
[% END %]
-<option value="[% ver | html %]"[% 'selected="selected"' IF ver == c.req.param('version') %]>[% ver | html %]</option>
+<option value="[% ver | html %]"[% ' selected' IF ver == selver %]>[% ver | html %]</option>
[% IF loop.last %]
</select>
[% END %]
[% END %]
-[% FOREACH arch = c.model('Mirrors').arch_list.keys.sort %]
+[% SET archs = c.model('Mirrors').arch_list.keys.sort %]
+[% SET selarch = c.req.param('arch') %]
+[% DEFAULT selarch = archs.-1 %]
+[% FOREACH arch = archs %]
[% IF loop.first %]
<select name="arch">
[% END %]
-<option value="[% arch | html %]"[% 'selected="selected"' IF arch == c.req.param('arch') %]>[% arch | html %]</option>
+<option value="[% arch | html %]"[% ' selected' IF arch == selarch %]>[% arch | html %]</option>
[% IF loop.last %]
</select>
[% END %]