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