]> git.sesse.net Git - ccbs/commitdiff
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 ae6d534fb2b3c0aac2e9243c091dcc7dec9792aa..a2da719fee68dfcf837221730d58bc07c4222ce6 100755 (executable)
@@ -6,6 +6,7 @@ use warnings;
 
 my $cgi = new CGI;
 my $id = $cgi->param('id');
 
 my $cgi = new CGI;
 my $id = $cgi->param('id');
+my $selected_player = $cgi->param('player');
 
 my $dbh = ccbs::db_connect();
 
 
 my $dbh = ccbs::db_connect();
 
@@ -17,6 +18,7 @@ ccbs::print_header();
 ccbs::process_template('registration.tmpl', $tournament->{'tournamentname'}, {
        tournament => $tournament,
        registered => $registered,
 ccbs::process_template('registration.tmpl', $tournament->{'tournamentname'}, {
        tournament => $tournament,
        registered => $registered,
-       available => $available
+       available => $available,
+       selected_player => $selected_player
 });
 $dbh->disconnect;
 });
 $dbh->disconnect;
index 73cdcdd4bcd73096cb4c940ab9e90c924bcf16a5..a51778fd15c81c8caaf9685038f29d58fce71975 100644 (file)
@@ -9,7 +9,11 @@
       <td>
         <select name="player">
 [% FOR a = available %]
       <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>
 [% END %]
         </select>
       </td>