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