1 package Gruntmaster
::Page
::Log
;
6 use Gruntmaster
::Page
::Base
log => 'Job log';
7 our @ISA = qw
/Gruntmaster::Page::Base/;
8 our $VERSION = '0.001';
10 use constant PAGE_SIZE
=> 10;
12 use constant FORMAT_EXTENSION
=> {
23 use constant TEMPLATES
=> {
27 <tr><th>ID<th>Problem<th>Date<th>Size<th>User<th>Result
29 <tmpl_loop log><tr><td><a href="job/<tmpl_var id>.var"><tmpl_var id></a>
30 <td><a href="../pb/<tmpl_var problem>"><tmpl_var name></a>
32 <td><a href="src/<tmpl_var id>.<tmpl_var extension>"<tmpl_if private> data-private</tmpl_if>><tmpl_var size></a></a>
33 <td><tmpl_var user><td class="r<tmpl_var result>"><tmpl_var result_text>
40 my ($self, $htc, $path, $lang) = @_;
42 $path =~ m
,^(?
:ct
/([^/]+)/)?log/(\w
+)\
.html
$,;
43 local $Gruntmaster::Data
::contest
= $1 if $1;
44 my $pages = POSIX
::ceil
(jobcard
/ PAGE_SIZE
);
45 my $page = $2 eq 'index' ?
$pages : $2;
47 my @log = sort { $b->{id
} <=> $a->{id
} } map +{
49 (job_private
() ?
(private
=> job_private
) : ()),
50 date
=> (job_date
() ? strftime
('%c' => localtime job_date
) : '?'),
51 extension
=> job_extension
,
52 name
=> problem_name job_problem
,
53 problem
=> job_problem
,
55 result_text
=> job_result_text
,
56 size
=> sprintf ("%.2f KiB", job_filesize
() / 1024),
57 user
=> job_user
}, ($page - 1) * PAGE_SIZE
+ 1 .. ($page == $pages ? jobcard
: $page * PAGE_SIZE
);
58 $htc->param(log => \
@log);