]> iEval git - gruntmaster-page.git/blob - lib/Gruntmaster/Page/Ct/Entry.pm
Make all generators inherit from a common base
[gruntmaster-page.git] / lib / Gruntmaster / Page / Ct / Entry.pm
1 package Gruntmaster::Page::Ct::Entry;
2
3 use 5.014000;
4 use strict;
5 use warnings;
6 use Gruntmaster::Page::Base ct_entry => '<tmpl_var name>';
7 our @ISA = qw/Gruntmaster::Page::Base/;
8 our $VERSION = '0.001';
9
10 use constant TEMPLATES => {
11 en => <<'HTML',
12 Contest start time: <tmpl_var start><br>
13 Contest end time: <tmpl_var end><p>
14
15 <tmpl_if started><a href="pb/">Problems</a><br>
16 <a href="log/">Job log</a><br>
17 <a href="log/st.var">Standings</a></tmpl_if>
18 HTML
19 };
20
21 sub _generate{
22 my ($self, $htc, $path, $lang) = @_;
23
24 $path = ($path =~ m,ct/(.*)/index,)[0];
25
26 $htc->param(id => $path);
27 $htc->param(name => contest_name $path);
28 $htc->param(start => strftime '%c', contest_start);
29 $htc->param(end => strftime '%c', contest_end);
30 $htc->param(started => time >= contest_start);
31 }
32
33 1
This page took 0.042345 seconds and 5 git commands to generate.