]> iEval git - gruntmaster-page.git/blame - lib/Gruntmaster/Page/Log/Entry.pm
Make Log::Entry table nicer
[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',
7f0f55d8
MG
12Compiler output:
13<pre><tmpl_var errors></pre>
14
15Results:
6b5b5f17 16<table border class="table table-border table-striped">
42546e6c
MG
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
bb95f538 24};
42546e6c 25
bb95f538 26sub _generate{
191f4979
MG
27 my ($self, $htc, $lang, $env, $ct, $id) = @_;
28 debug $env => "language is '$lang', contest is '$ct' and id is '$id'";
3c53f795 29 local $Gruntmaster::Data::contest = $ct if $ct;
cd9af27e 30
b83e43dc
MG
31 my @tests = ();
32
33 eval {
34 @tests = map {
35 $_->{time} = sprintf "%.4fs", $_->{time};
36 $_
37 } @{job_results $id};
38 };
cd9af27e
MG
39
40 $htc->param(id => $id);
41 $htc->param(tests => \@tests);
7f0f55d8 42 $htc->param(errors => job_errors $id)
42546e6c
MG
43}
44
451
This page took 0.03516 seconds and 4 git commands to generate.