Added template code for showing rank.
authorSteinar H. Gunderson <sesse@samfundet.no>
Thu, 17 Feb 2005 18:54:47 +0000 (18:54 +0000)
committerSteinar H. Gunderson <sesse@samfundet.no>
Thu, 17 Feb 2005 18:54:47 +0000 (18:54 +0000)
html/show-tournament.pl
html/templates/show-tournament.tmpl

index 0a59d71..f5ecf31 100755 (executable)
@@ -61,7 +61,7 @@ for my $score (@$scores) {
        my $pl = $p->[$#$p]->{'players'};
        if ($score->{'nick'} ne $player) {
                $player = $score->{'nick'};
-               push @$pl, { player => $score->{'player'}, nick => $player, songs => [], total => 0 };
+               push @$pl, { player => $score->{'player'}, nick => $player, songs => [], total => 0, rank => 1 };
        }
        
        push @{$pl->[$#$pl]->{'songs'}}, $score;
index 0c4e350..a5c539e 100644 (file)
     [% IF p.num_songs > 1 %]
       <th>Total</th>
     [% END %]      
+      <th>Rank</th>
     [% IF !r.locked %]
       <th></th>
     [% END %]      
         [% IF p.num_songs > 1 %]
      <td>[% pl.total %]</td>
         [% END %]      
+     <td>[% pl.rank %]</td>
     </tr>
       [% ELSE %]
     <tr>
         [% IF p.num_songs > 1 %]
      <td>[% pl.total %]</td>
         [% END %]
+     <td>[% pl.rank %]</td>
      <td><input type="submit" value="Oppdater" /></td>
     </tr>
       [% END %]