]> iEval git - plack-app-gruntmaster.git/blame_incremental - lib/Gruntmaster/Page/Log/Entry.pm
Make all generators inherit from a common base
[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',
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>
19HTML
20};
21
22sub _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 = map {
30 $_->{time} = sprintf "%.4fs", $_->{time};
31 $_
32 } @{job_results $id};
33
34 $htc->param(id => $id);
35 $htc->param(tests => \@tests);
36}
37
381
This page took 0.017393 seconds and 4 git commands to generate.