]> git.sesse.net Git - wloh/blobdiff - www/index.pl
Remove password that leaked out into the git repository. (It has also been changed...
[wloh] / www / index.pl
index 4fef4a7e4e319abe764e9edf78b844412cbb753d..eb6d1761f613376d16bc4dd9dc98d07043337621 100755 (executable)
@@ -200,12 +200,11 @@ sub make_table {
 
        my $num_games = scalar keys %prob;
 
-       # Make list of ranks.
+       # Make list of ranks. (Relegation is handled specially.)
        my @ranks = ();
        for my $i (1..$num_games) {
-               push @ranks, { 'th' => "$i." };
+               push @ranks, { 'th' => wloh_common::get_ordinal($i, $locale) };
        }
-       push @ranks, { 'th' => 'NEDRYKK' } unless ($lowest_division);
 
        my @players = ();
 
@@ -262,10 +261,12 @@ sub make_table {
                };
        }
 
-       return {
+       my $parms = {
                'ranks' => \@ranks,
                'tbody' => \@players,
        };
+       $parms->{'relegation'} = '' if ($lowest_division);
+       return $parms;
 }
 
 sub make_cov_table {
@@ -379,13 +380,13 @@ if (defined($match_player) && defined($match_position)) {
                print CGI->header(-type=>'text/html; charset=utf-8', -expires=>'+5m');
                wloh_common::process_template('scenario-not-found', $locale, {
                        '#nick' => $player_name,
-                       '#rank' => sprintf("%d.", $match_position + 1)
+                       '#rank' => wloh_common::get_ordinal($match_position + 1, $locale)
                });
        } else {
                print CGI->header(-type=>'text/html; charset=utf-8', -expires=>'+5m');
                wloh_common::process_template('scenario', $locale, {
                        '#nick' => $player_name,
-                       '#rank' => sprintf("%d.", $match_position + 1),
+                       '#rank' => wloh_common::get_ordinal($match_position + 1, $locale),
                        '#results' => \@scenario
                });
        }