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