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