]> iEval git - plack-app-gruntmaster.git/blame_incremental - lib/Gruntmaster/Page/Log/Entry.pm
Add compile errors
[plack-app-gruntmaster.git] / lib / Gruntmaster / Page / Log / Entry.pm
... / ...
CommitLineData
1package Gruntmaster::Page::Log::Entry;
2
3use 5.014000;
4use strict;
5use warnings;
6use Gruntmaster::Page::Base log_entry => 'Job <tmpl_var id>';
7our @ISA = qw/Gruntmaster::Page::Base/;
8our $VERSION = '0.001';
9
10use constant TEMPLATES => {
11 en => <<'HTML',
12Compiler output:
13<pre><tmpl_var errors></pre>
14
15Results:
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>
23HTML
24};
25
26sub _generate{
27 my ($self, $htc, $path, $lang) = @_;
28
29 $path =~ m,^(?:ct/([^/]+)/)?log/job/([^/]+)\.html$,;
30 local $Gruntmaster::Data::contest = $1;
31 my $id = $2;
32
33 my @tests = ();
34
35 eval {
36 @tests = map {
37 $_->{time} = sprintf "%.4fs", $_->{time};
38 $_
39 } @{job_results $id};
40 };
41
42 $htc->param(id => $id);
43 $htc->param(tests => \@tests);
44 $htc->param(errors => job_errors $id)
45}
46
471
This page took 0.022645 seconds and 4 git commands to generate.