]>
iEval git - gruntmaster-page.git/blob - lib/Gruntmaster/Page/Log.pm
1 package Gruntmaster
::Page
::Log
;
3 use Gruntmaster
::Page
::Base
log => 'Job log';
5 use constant PAGE_SIZE
=> 10;
8 my ($self, $htc, $lang, $env, $ct, $page) = @_;
9 debug
$env => "language is '$lang', contest is '$ct' and page is '$page'";
10 local $Gruntmaster::Data
::contest
= $ct if $ct;
12 my $pages = POSIX
::floor
(jobcard
/ PAGE_SIZE
);
16 my @log = sort { $b->{id
} <=> $a->{id
} } map +{
18 (job_private
() ?
(private
=> job_private
) : ()),
19 date
=> (job_date
() ? strftime
('%c' => localtime job_date
) : '?'),
20 extension
=> job_extension
,
21 name
=> problem_name job_problem
,
22 problem
=> job_problem
,
24 result_text
=> job_result_text
,
25 size
=> sprintf ("%.2f KiB", job_filesize
() / 1024),
26 user
=> job_user
}, ($page - 1) * PAGE_SIZE
+ 1 .. ($page == $pages ? jobcard
: $page * PAGE_SIZE
);
27 $_->{user_name
} = do { local $Gruntmaster::Data
::contest
; user_name
$_->{user
} } for @log;
28 $htc->param(log => \
@log);
29 $htc->param(next => $page + 1) unless $page == $pages;
30 $htc->param(prev
=> $page - 1) unless $page == 1;
This page took 0.067769 seconds and 4 git commands to generate.