]>
Commit | Line | Data |
---|---|---|
1 | package Gruntmaster::Page::Log::Entry; | |
2 | ||
3 | use 5.014000; | |
4 | use strict; | |
5 | use warnings; | |
6 | use Gruntmaster::Page::Base log_entry => 'Job <tmpl_var id>'; | |
7 | our @ISA = qw/Gruntmaster::Page::Base/; | |
8 | our $VERSION = '0.001'; | |
9 | ||
10 | use constant TEMPLATES => { | |
11 | en => <<'HTML', | |
12 | <table border> | |
13 | <thead> | |
14 | <tr><th>Test number<th>Result<th>Time | |
15 | <tbody> | |
16 | <tmpl_loop tests><tr><td><tmpl_var id><td class="r<tmpl_var result>"><tmpl_var result_text><td><tmpl_var time> | |
17 | </tmpl_loop> | |
18 | </table> | |
19 | HTML | |
20 | }; | |
21 | ||
22 | sub _generate{ | |
23 | my ($self, $htc, $path, $lang) = @_; | |
24 | ||
25 | $path =~ m,^(?:ct/([^/]+)/)?log/job/([^/]+)\.html$,; | |
26 | local $Gruntmaster::Data::contest = $1; | |
27 | my $id = $2; | |
28 | ||
29 | my @tests = (); | |
30 | ||
31 | eval { | |
32 | @tests = map { | |
33 | $_->{time} = sprintf "%.4fs", $_->{time}; | |
34 | $_ | |
35 | } @{job_results $id}; | |
36 | }; | |
37 | ||
38 | $htc->param(id => $id); | |
39 | $htc->param(tests => \@tests); | |
40 | } | |
41 | ||
42 | 1 |