Automatically zoom to the new player when adding a new one.
authorSteinar H. Gunderson <sesse@samfundet.no>
Thu, 17 Feb 2005 19:36:51 +0000 (19:36 +0000)
committerSteinar H. Gunderson <sesse@samfundet.no>
Thu, 17 Feb 2005 19:36:51 +0000 (19:36 +0000)
html/registration.pl
html/templates/registration.tmpl

index ae6d534..a2da719 100755 (executable)
@@ -6,6 +6,7 @@ use warnings;
 
 my $cgi = new CGI;
 my $id = $cgi->param('id');
+my $selected_player = $cgi->param('player');
 
 my $dbh = ccbs::db_connect();
 
@@ -17,6 +18,7 @@ ccbs::print_header();
 ccbs::process_template('registration.tmpl', $tournament->{'tournamentname'}, {
        tournament => $tournament,
        registered => $registered,
-       available => $available
+       available => $available,
+       selected_player => $selected_player
 });
 $dbh->disconnect;
index 73cdcdd..a51778f 100644 (file)
@@ -9,7 +9,11 @@
       <td>
         <select name="player">
 [% FOR a = available %]
-          <option value="[% a.player %]">[% a.nick %]</option>
+[% IF a.player == selected_player %]
+           <option value="[% a.player %]" selected="selected">[% a.nick %]</option>
+[% ELSE %]
+           <option value="[% a.player %]">[% a.nick %]</option>
+[% END %]
 [% END %]
         </select>
       </td>