X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FPage%2FLog.pm;h=f46e6a9e93e836e27f38731b6424d19c73b05f57;hb=7dc3247307f2e86af154dc449224f22ba8923c79;hp=c9d0dfb60834a277e9b6ff58071ce6a68d2fc64c;hpb=e9e5c8a440a6e3a088a4b9330650e310561ef518;p=plack-app-gruntmaster.git diff --git a/lib/Gruntmaster/Page/Log.pm b/lib/Gruntmaster/Page/Log.pm index c9d0dfb..f46e6a9 100644 --- a/lib/Gruntmaster/Page/Log.pm +++ b/lib/Gruntmaster/Page/Log.pm @@ -15,27 +15,27 @@ use constant TEMPLATES => { IDProblemDateSizeUserResult - - + + data-private> -Prev page -Next page +Prev page +Next page HTML }; sub _generate{ - my ($self, $htc, $path, $lang) = @_; + my ($self, $htc, $lang, $logger, $ct, $page) = @_; + debug $logger => "language is '$lang', contest is '$ct' and page is '$page'"; + local $Gruntmaster::Data::contest = $ct if $ct; - $path =~ m,^(?:ct/([^/]+)/)?log/(\w+)\.html$,; - local $Gruntmaster::Data::contest = $1 if $1; my $pages = POSIX::floor (jobcard / PAGE_SIZE); $pages ||= 1; - my $page = $2 eq 'index' ? $pages : $2; + $page //= $pages; my @log = sort { $b->{id} <=> $a->{id} } map +{ id => $_,