X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FPage%2FSt.pm;h=b50490c00f3e31d6d22382c45b5003148373d6cc;hb=746789c0a194d8151e7e9dd830365e218206601f;hp=dafd5df249e21b1604441d1ba0033e12b4a3080c;hpb=bb95f538bf263c0294d87cfb90d58c66117b9aab;p=plack-app-gruntmaster.git diff --git a/lib/Gruntmaster/Page/St.pm b/lib/Gruntmaster/Page/St.pm index dafd5df..b50490c 100644 --- a/lib/Gruntmaster/Page/St.pm +++ b/lib/Gruntmaster/Page/St.pm @@ -7,15 +7,18 @@ use Gruntmaster::Page::Base st => 'Standings'; our @ISA = qw/Gruntmaster::Page::Base/; our $VERSION = '0.001'; -use constant => TEMPLATES => { +use constant TEMPLATES => { en => <<'HTML', -
UsernameTotal +
UsernameTotal +
UsernameScore + +
- - + +
HTML @@ -24,9 +27,11 @@ HTML sub _generate{ my ($self, $htc, $path, $lang) = @_; - local $Gruntmaster::Data::contest = ($path =~ m,^ct/([^/]+)/,)[0]; + $path =~ m,^(?:ct/([^/]+)/)?,; + local $Gruntmaster::Data::contest = $1; - my @problems = sort problems; + my @problems = problems; + @problems = sort @problems; my %scores; for (1 .. jobcard) { if (job_result_text =~ m/^(\d+)/) { @@ -44,7 +49,7 @@ sub _generate{ scores => [map { $scores{$user}{$_} // '-'} @problems], } } keys %scores; - $htc->param(problems => \@problems); + $htc->param(problems => [map { problem_name } @problems ]) if $Gruntmaster::Data::contest; $htc->param(st => \@st); }