]>
iEval git - plack-app-gruntmaster.git/blob - lib/Gruntmaster/Page/Pb/Entry.pm
1 package Gruntmaster
::Page
::Pb
::Entry
;
6 use parent qw
/Exporter/;
7 our @EXPORT_OK = qw
/generate/;
8 our $VERSION = '0.001';
11 use HTML
::Template
::Compiled
;
13 use POSIX qw
/strftime/;
14 use File
::Basename qw
/fileparse/;
15 use Gruntmaster
::Page
::Common qw
/header footer/;
16 use Gruntmaster
::Data qw
/contest_start contest_end problem_name problem_statement/;
18 use constant FORMATS
=> [qw
/CPP/];
19 use constant TITLE
=> '<tmpl_var name>';
26 <h1>Submit solution</h1>
27 <form action="https://gm.ieval.ro/action/submit" method="POST" enctype="multipart/form-data">
28 <input type="hidden" name="problem" value="<tmpl_var id>">
29 <tmpl_if_defined contest><input type="hidden" name="contest" value="<tmpl_var contest>"></tmpl_if_defined>
30 <label>File: <input name="prog" required type="file"></label>
32 <label>File format: <select name="prog_format" required>
33 <tmpl_loop formats><option value="<tmpl_var _>"><tmpl_var _></option>
34 </tmpl_loop></select></label>
36 <input type="submit" value="Submit job">
42 $templates{$_} = header
($_, TITLE
) . $templates{$_} for keys %templates;
43 $templates{$_} .= footer
$_ for keys %templates;
46 $_[0] =~ m
,(?
:ct
/([^/])+/)?pb/(\w
+)\
.html
$,;
48 my ($contest, $id) = ($1, $2);
49 my $htc = HTML
::Template
::Compiled
->new(scalarref
=> \
$templates{$_[1]});
51 $htc->param(cansubmit
=> 1);
52 if (defined $contest) {
53 $htc->param(cansubmit
=> time >= contest_start
$contest && time <= contest_end
$contest);
54 $htc->param(contest
=> $contest);
56 $htc->param(formats
=> FORMATS
);
57 $htc->param(id
=> $id);
58 local $Gruntmaster::Data
::contest
= $contest if $contest;
59 $htc->param(name
=> problem_name
$id);
60 $htc->param(statement
=> problem_statement
$id);
This page took 0.048616 seconds and 4 git commands to generate.