]> iEval git - gruntmaster-page.git/blobdiff - lib/Gruntmaster/Page/Submit.pm
Make all generators inherit from a common base
[gruntmaster-page.git] / lib / Gruntmaster / Page / Submit.pm
index 7e4d1634d27ca6ef328cc530b4e095db02c4a976..cdb4f7d5fc396b6547ef7a71c4925ad7b5ff54c4 100644 (file)
@@ -3,17 +3,13 @@ package Gruntmaster::Page::Submit;
 use 5.014000;
 use strict;
 use warnings;
-use parent qw/Exporter/;
-our @EXPORT_OK = qw/generate/;
+use Gruntmaster::Page::Base submit => 'Submit job';
+our @ISA = qw/Gruntmaster::Page::Base/;
 our $VERSION = '0.001';
 
 use constant FORMATS => [qw/CPP/];
 
-use HTML::Template::Compiled;
-use Gruntmaster::Page::Common qw/cook_templates reload_templates/;
-use Gruntmaster::Data qw/problem_name problems/;
-
-my %orig_templates = (
+use constant TEMPLATES => {
        en => <<'HTML',
 <form action="https://gm.ieval.ro/action/submit" method="POST" enctype="multipart/form-data">
 <label>Problem:<br>
@@ -31,18 +27,14 @@ my %orig_templates = (
 
 <input type="submit" value="Submit job">
 HTML
-);
-
-my %templates = cook_templates %orig_templates, submit => 'Submit job';
+};
 
-sub generate{
-       %templates = cook_templates %orig_templates, submit => 'Submit job' if reload_templates;
+sub _generate{
+       my ($self, $htc, $path, $lang) = @_;
 
-       my $htc = HTML::Template::Compiled->new(scalarref => \$templates{$_[1]});
        my @problems = map +{ id => $_, name => problem_name }, problems;
        $htc->param(problems => \@problems);
        $htc->param(formats => FORMATS);
-       $htc->output
 }
 
 1
This page took 0.024025 seconds and 4 git commands to generate.