X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FPage%2FCt.pm;h=8ef38155306fe9b42ec55e92089b04a6a5282086;hb=2b0036ac8e077cc20cf9db6ff8dad4091ab50cb3;hp=19c4aad33cc319d4504768eb2b7fc8c30c4ac47a;hpb=879063d7deb100035d21ff2be57dce8d090b431f;p=plack-app-gruntmaster.git diff --git a/lib/Gruntmaster/Page/Ct.pm b/lib/Gruntmaster/Page/Ct.pm index 19c4aad..8ef3815 100644 --- a/lib/Gruntmaster/Page/Ct.pm +++ b/lib/Gruntmaster/Page/Ct.pm @@ -7,14 +7,12 @@ use parent qw/Exporter/; our @EXPORT_OK = qw/generate/; our $VERSION = '0.001'; -use constant TITLE => 'Contests'; - use HTML::Template::Compiled; use POSIX qw/strftime/; -use Gruntmaster::Page::Common qw/header footer/; +use Gruntmaster::Page::Common qw/cook_templates reload_templates/; use Gruntmaster::Data qw/contest_name contest_start contest_end contest_owner/; -my %templates = ( +my %orig_templates = ( en => <<'HTML',

Running contests

@@ -60,10 +58,10 @@ my %templates = ( HTML ); -$templates{$_} = header($_, TITLE) . $templates{$_} for keys %templates; -$templates{$_} .= footer $_ for keys %templates; +my %templates = cook_templates %orig_templates, ct => 'Contests'; sub generate{ + %templates = cook_templates %orig_templates, ct => 'Contests' if reload_template; my $htc = HTML::Template::Compiled->new(scalarref => \$templates{$_[1]}); my (@running, @pending, @finished);