]>
Commit | Line | Data |
---|---|---|
1 | package Gruntmaster::Page::Pb::Entry; | |
2 | ||
3 | use Gruntmaster::Page::Base pb_entry => '<tmpl_var name>'; | |
4 | ||
5 | use constant FORMATS => [qw/C CPP JAVA PERL PYTHON/]; | |
6 | ||
7 | sub _generate{ | |
8 | my ($self, $htc, $lang, $env, $contest, $id) = @_; | |
9 | debug $env => "language is '$lang', contest is '$contest', id is '$id'"; | |
10 | my $user = $env->{REMOTE_USER}; | |
11 | if ($contest && $user && time >= contest_start $contest) { | |
12 | local $Gruntmaster::Data::contest = $contest; | |
13 | mark_open $id, $user; | |
14 | debug $env => "Marking problem $id of contest $contest open by $user"; | |
15 | } | |
16 | ||
17 | $htc->param(cansubmit => 1); | |
18 | if ($contest) { | |
19 | $htc->param(cansubmit => time <= contest_end $contest); | |
20 | $htc->param(contest => $contest); | |
21 | } | |
22 | $htc->param(formats => FORMATS); | |
23 | $htc->param(id => $id); | |
24 | local $Gruntmaster::Data::contest = $contest if $contest; | |
25 | $htc->param(name => problem_name $id); | |
26 | $htc->param(author => problem_author $id); | |
27 | $htc->param(owner => problem_owner $id); | |
28 | $htc->param(statement => problem_statement $id); | |
29 | } | |
30 | ||
31 | sub vary { 'Authorization' } | |
32 | sub max_age { 600 } | |
33 | ||
34 | 1 |