]> iEval git - gruntmaster-page.git/blame - lib/Gruntmaster/Page/Log/Entry.pm
Add log pagination, allow jo and fix bugs in log/log_entry
[gruntmaster-page.git] / lib / Gruntmaster / Page / Log / Entry.pm
CommitLineData
42546e6c
MG
1package Gruntmaster::Page::Log::Entry;
2
3use 5.014000;
4use strict;
5use warnings;
bb95f538
MG
6use Gruntmaster::Page::Base log_entry => 'Job <tmpl_var id>';
7our @ISA = qw/Gruntmaster::Page::Base/;
42546e6c
MG
8our $VERSION = '0.001';
9
bb95f538 10use constant TEMPLATES => {
cd9af27e 11 en => <<'HTML',
42546e6c
MG
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
bb95f538 20};
42546e6c 21
bb95f538
MG
22sub _generate{
23 my ($self, $htc, $path, $lang) = @_;
42546e6c 24
bb95f538 25 $path =~ m,^(?:ct/([^/]+)/)?log/job/([^/]+)\.html$,;
cd9af27e
MG
26 local $Gruntmaster::Data::contest = $1;
27 my $id = $2;
28
b83e43dc
MG
29 my @tests = ();
30
31 eval {
32 @tests = map {
33 $_->{time} = sprintf "%.4fs", $_->{time};
34 $_
35 } @{job_results $id};
36 };
cd9af27e
MG
37
38 $htc->param(id => $id);
39 $htc->param(tests => \@tests);
42546e6c
MG
40}
41
421
This page took 0.027922 seconds and 4 git commands to generate.