From: Marius Gavrilescu Date: Wed, 29 Jan 2014 12:53:06 +0000 (+0200) Subject: Fix short job logs X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=b9d003fd060ca4af99273a8d2915bfd7de5cb14c;p=plack-app-gruntmaster.git Fix short job logs --- diff --git a/lib/Gruntmaster/Page/Log.pm b/lib/Gruntmaster/Page/Log.pm index 2379e80..c9d0dfb 100644 --- a/lib/Gruntmaster/Page/Log.pm +++ b/lib/Gruntmaster/Page/Log.pm @@ -34,6 +34,7 @@ sub _generate{ $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; my @log = sort { $b->{id} <=> $a->{id} } map +{