]> git.sesse.net Git - ccbs/blobdiff - html/show-tournament.pl
Added a link to "start tournament" in the tournament listing.
[ccbs] / html / show-tournament.pl
index 8d6dc45009d8bf8ce86652cf7fd1bb9253f1a958..b204270422048e58ee57d461c324df362a509efb 100755 (executable)
@@ -30,7 +30,7 @@ for my $score (@$scores) {
        my $p = $rounds[$#rounds]->{'parallels'};
        if ($score->{'parallel'} != $parallel) {
                $parallel = $score->{'parallel'};
-               push @$p, { parallel => $parallel, players => [], songs => [] };
+               push @$p, { parallel => $parallel, players => [], songs => [], num_songs => 0 };
                $player = '';
 
                # Information on songs is not selected from roundrandomsongs etc.,
@@ -43,12 +43,13 @@ for my $score (@$scores) {
                } else {
                        push @{$p->[$#$p]->{'songs'}}, $score->{'title'};
                }
+               $p->[$#$p]->{'num_songs'}++;
        }
        
        my $pl = $p->[$#$p]->{'players'};
        if ($score->{'nick'} ne $player) {
                $player = $score->{'nick'};
-               push @$pl, { nick => $player, songs => [] };
+               push @$pl, { nick => $player, songs => [], total => 0 };
 
        }
        
@@ -57,6 +58,7 @@ for my $score (@$scores) {
                chosen => $score->{'chosen'},
                score => $score->{'score'}
        };
+       $pl->[$#$pl]->{'total'} += $score->{'score'};
 }
 
 ccbs::print_header();