<tr><th>ID<th>Problem<th>Date<th>Size<th>User<th>Result
<tbody>
<tmpl_loop log><tr><td><a href="job/<tmpl_var id>.var"><tmpl_var id></a>
-<td><a href="../pb/<tmpl_var problem>"><tmpl_var name></a>
+<td><a href="/pb/<tmpl_var problem>.var"><tmpl_var name></a>
<td><tmpl_var date>
-<td><a href="src/<tmpl_var id>.<tmpl_var extension>"<tmpl_if private> data-private</tmpl_if>><tmpl_var size></a></a>
+<td><a href="src/<tmpl_var id>.<tmpl_var extension>"<tmpl_if private> data-private</tmpl_if>><tmpl_var size></a>
<td><tmpl_var user><td class="r<tmpl_var result>"><tmpl_var result_text>
</tmpl_loop>
</table>
+
+<tmpl_if prev><a href="<tmpl_var prev>.var">Prev page</a></tmpl_if>
+<tmpl_if next><a href="<tmpl_var next>.var">Next page</a></tmpl_if>
HTML
};
$path =~ m,^(?:ct/([^/]+)/)?log/(\w+)\.html$,;
local $Gruntmaster::Data::contest = $1 if $1;
- my $pages = POSIX::ceil (jobcard / PAGE_SIZE);
+ my $pages = POSIX::floor (jobcard / PAGE_SIZE);
my $page = $2 eq 'index' ? $pages : $2;
my @log = sort { $b->{id} <=> $a->{id} } map +{
size => sprintf ("%.2f KiB", job_filesize() / 1024),
user => job_user}, ($page - 1) * PAGE_SIZE + 1 .. ($page == $pages ? jobcard : $page * PAGE_SIZE);
$htc->param(log => \@log);
+ $htc->param(next => $page + 1) unless $page == $pages;
+ $htc->param(prev => $page - 1) unless $page == 1;
}
1
local $Gruntmaster::Data::contest = $1;
my $id = $2;
- my @tests = map {
- $_->{time} = sprintf "%.4fs", $_->{time};
- $_
- } @{job_results $id};
+ my @tests = ();
+
+ eval {
+ @tests = map {
+ $_->{time} = sprintf "%.4fs", $_->{time};
+ $_
+ } @{job_results $id};
+ };
$htc->param(id => $id);
$htc->param(tests => \@tests);