]> iEval git - gruntmaster-page.git/blame_incremental - lib/Gruntmaster/Page/Pb/Entry.pm
Make contest problem entries more cacheable
[gruntmaster-page.git] / lib / Gruntmaster / Page / Pb / Entry.pm
... / ...
CommitLineData
1package Gruntmaster::Page::Pb::Entry;
2
3use 5.014000;
4use strict;
5use warnings;
6use Gruntmaster::Page::Base pb_entry => '<tmpl_var name>';
7our @ISA = qw/Gruntmaster::Page::Base/;
8our $VERSION = '0.001';
9
10use constant FORMATS => [qw/C CPP JAVA PERL PYTHON/];
11
12sub _generate{
13 my ($self, $htc, $lang, $env, $contest, $id) = @_;
14 debug $env => "language is '$lang', contest is '$contest', id is '$id'";
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 }
20
21 $htc->param(cansubmit => 1);
22 if ($contest) {
23 $htc->param(cansubmit => time <= contest_end $contest);
24 $htc->param(contest => $contest);
25 }
26 $htc->param(formats => FORMATS);
27 $htc->param(id => $id);
28 local $Gruntmaster::Data::contest = $contest if $contest;
29 $htc->param(name => problem_name $id);
30 $htc->param(author => problem_author $id);
31 $htc->param(owner => problem_owner $id);
32 $htc->param(statement => problem_statement $id);
33}
34
35sub vary { 'Authorization' }
36sub max_age { 600 }
37
381
This page took 0.017896 seconds and 4 git commands to generate.