]>
iEval git - gruntmaster-page.git/blob - lib/Gruntmaster/Page/Pb/Entry.pm
1 package Gruntmaster
::Page
::Pb
::Entry
;
6 use Gruntmaster
::Page
::Base pb_entry
=> '<tmpl_var name>';
7 our @ISA = qw
/Gruntmaster::Page::Base/;
8 our $VERSION = '0.001';
10 use constant TEMPLATES
=> {
13 <div class="col-md-9">
14 <tmpl_var ESCAPE=0 statement>
17 <div class="col-md-3">
18 <div id="sidebar"></div>
20 <h3>Problem information</h3>
22 <dt>Author</dt> <dd><tmpl_var author></dd>
23 <dt>Owner</dt> <dd><tmpl_var owner></dd>
27 <h1>Submit solution</h1>
28 <form action="<tmpl_var id>/submit" method="POST" enctype="multipart/form-data" role="form">
29 <input type="hidden" name="problem" value="<tmpl_var id>">
30 <tmpl_if_defined contest><input type="hidden" name="contest" value="<tmpl_var contest>"></tmpl_if_defined>
32 <div class="form-group"><label for="prog">File:</label><input id="prog" name="prog" type="file"></div>
33 <div class="form-group"><label for="source_code">Source code:</label> <textarea class="form-control" id="source_code" name="source_code"></textarea></div>
34 <div class="form-group"><label for="prog_format">File format:</label><select id="prog_format" name="prog_format" class="form-control" required>
35 <tmpl_loop formats><option value="<tmpl_var _>"><tmpl_var _></option>
36 </tmpl_loop></select></div>
38 <input type="submit" value="Submit job" class="btn btn-primary">
45 use constant FORMATS
=> [qw
/C CPP MONO JAVA PASCAL PERL PYTHON/];
48 my ($self, $htc, $lang, $env, $contest, $id) = @_;
49 debug
$env => "language is '$lang', contest is '$contest', id is '$id'";
51 $htc->param(cansubmit
=> 1);
53 $htc->param(cansubmit
=> 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(author
=> problem_author
$id);
61 $htc->param(owner
=> problem_owner
$id);
62 $htc->param(statement
=> problem_statement
$id);
This page took 0.051504 seconds and 4 git commands to generate.