X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FPage%2FSt.pm;h=e3873ba51b418de037516ca24a52b7470f898757;hb=2b0036ac8e077cc20cf9db6ff8dad4091ab50cb3;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..e3873ba 100644 --- a/lib/Gruntmaster/Page/St.pm +++ b/lib/Gruntmaster/Page/St.pm @@ -7,15 +7,13 @@ use parent qw/Exporter/; our @EXPORT_OK = qw/generate/; 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::Page::Common qw/cook_templates reload_templates/; use Gruntmaster::Data qw/problems jobcard job_result_text job_result job_problem job_user/; -my %templates = ( +my %orig_templates = ( en => <<'HTML', @@ -29,10 +27,10 @@ my %templates = ( HTML ); -$templates{$_} = header($_, TITLE) . $templates{$_} for keys %templates; -$templates{$_} .= footer $_ for keys %templates; +my %templates = cook_templates %orig_templates, st => 'Standings'; sub generate{ + %templates = cook_templates %orig_templates, st => 'Standings' if reload_templates; local $Gruntmaster::Data::contest = ($_[0] =~ m,^ct/([^/]+)/,)[0]; my $htc = HTML::Template::Compiled->new(scalarref => \$templates{$_[1]});