]>
Commit | Line | Data |
---|---|---|
42546e6c MG |
1 | package Gruntmaster::Page::Submit; |
2 | ||
3 | use 5.014000; | |
4 | use strict; | |
5 | use warnings; | |
bb95f538 MG |
6 | use Gruntmaster::Page::Base submit => 'Submit job'; |
7 | our @ISA = qw/Gruntmaster::Page::Base/; | |
42546e6c MG |
8 | our $VERSION = '0.001'; |
9 | ||
10 | use constant FORMATS => [qw/CPP/]; | |
42546e6c | 11 | |
bb95f538 | 12 | use constant TEMPLATES => { |
cd9af27e | 13 | en => <<'HTML', |
42546e6c MG |
14 | <form action="https://gm.ieval.ro/action/submit" method="POST" enctype="multipart/form-data"> |
15 | <label>Problem:<br> | |
16 | <select name="problem" required> | |
17 | <tmpl_loop problems><option value="<tmpl_var id>"><tmpl_var name></option> | |
18 | </tmpl_loop></select></label><p> | |
19 | ||
20 | <label>File:<br> | |
21 | <input name="prog" required type="file"></label><p> | |
22 | ||
23 | <label>File format:<br> | |
24 | <select name="prog_format" required> | |
25 | <tmpl_loop formats><option value="<tmpl_var _>"><tmpl_var _></option> | |
26 | </tmpl_loop></select></label><p> | |
27 | ||
28 | <input type="submit" value="Submit job"> | |
29 | HTML | |
bb95f538 | 30 | }; |
42546e6c | 31 | |
bb95f538 MG |
32 | sub _generate{ |
33 | my ($self, $htc, $path, $lang) = @_; | |
2b0036ac | 34 | |
cd9af27e MG |
35 | my @problems = map +{ id => $_, name => problem_name }, problems; |
36 | $htc->param(problems => \@problems); | |
37 | $htc->param(formats => FORMATS); | |
42546e6c MG |
38 | } |
39 | ||
40 | 1 |