]>
Commit | Line | Data |
---|---|---|
fe78f0c1 MG |
1 | package Gruntmaster::Page::Ct::Entry; |
2 | ||
3 | use 5.014000; | |
4 | use strict; | |
5 | use warnings; | |
bb95f538 MG |
6 | use Gruntmaster::Page::Base ct_entry => '<tmpl_var name>'; |
7 | our @ISA = qw/Gruntmaster::Page::Base/; | |
fe78f0c1 MG |
8 | our $VERSION = '0.001'; |
9 | ||
bb95f538 | 10 | use constant TEMPLATES => { |
cd9af27e | 11 | en => <<'HTML', |
fe78f0c1 MG |
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> | |
5bbf0128 | 17 | <a href="log/st.var">Standings</a></tmpl_if> |
fe78f0c1 | 18 | HTML |
bb95f538 | 19 | }; |
fe78f0c1 | 20 | |
bb95f538 MG |
21 | sub _generate{ |
22 | my ($self, $htc, $path, $lang) = @_; | |
fe78f0c1 | 23 | |
cd9af27e | 24 | $path = ($path =~ m,ct/(.*)/index,)[0]; |
cd9af27e MG |
25 | |
26 | $htc->param(id => $path); | |
27 | $htc->param(name => contest_name $path); | |
864be20f MG |
28 | $htc->param(start => strftime '%c', localtime contest_start $path); |
29 | $htc->param(end => strftime '%c', localtime contest_end $path); | |
30 | $htc->param(started => time >= contest_start $path); | |
fe78f0c1 MG |
31 | } |
32 | ||
33 | 1 |