X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FPage%2FSt.pm;h=dafd5df249e21b1604441d1ba0033e12b4a3080c;hb=e57ca30a8f44b2af769c55bb09222bb4c170499b;hp=e5b418d26a7844767e06c053b8d5ac05175720dd;hpb=cd9af27e94244e6454c3db787a8ca6811f44fc16;p=plack-app-gruntmaster.git diff --git a/lib/Gruntmaster/Page/St.pm b/lib/Gruntmaster/Page/St.pm index e5b418d..dafd5df 100644 --- a/lib/Gruntmaster/Page/St.pm +++ b/lib/Gruntmaster/Page/St.pm @@ -3,19 +3,11 @@ package Gruntmaster::Page::St; use 5.014000; use strict; use warnings; -use parent qw/Exporter/; -our @EXPORT_OK = qw/generate/; +use Gruntmaster::Page::Base st => 'Standings'; +our @ISA = qw/Gruntmaster::Page::Base/; our $VERSION = '0.001'; -use constant TITLE => 'Standings'; - -use HTML::Template::Compiled; -use List::Util qw/sum/; -use POSIX qw/strftime/; -use Gruntmaster::Page::Common qw/header footer/; -use Gruntmaster::Data qw/problems jobcard job_result_text job_result job_problem job_user/; - -my %templates = ( +use constant => TEMPLATES => { en => <<'HTML', @@ -27,14 +19,12 @@ my %templates = (
HTML -); +}; -$templates{$_} = header($_, TITLE) . $templates{$_} for keys %templates; -$templates{$_} .= footer $_ for keys %templates; +sub _generate{ + my ($self, $htc, $path, $lang) = @_; -sub generate{ - local $Gruntmaster::Data::contest = ($_[0] =~ m,^ct/([^/]+)/,)[0]; - my $htc = HTML::Template::Compiled->new(scalarref => \$templates{$_[1]}); + local $Gruntmaster::Data::contest = ($path =~ m,^ct/([^/]+)/,)[0]; my @problems = sort problems; my %scores; @@ -56,7 +46,6 @@ sub generate{ } keys %scores; $htc->param(problems => \@problems); $htc->param(st => \@st); - $htc->output } 1