X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FPage%2FCt%2FEntry.pm;fp=lib%2FGruntmaster%2FPage%2FCt%2FEntry.pm;h=bba2991c6e8a13d5fbeebbd473cbd440cb2806a4;hb=2b0036ac8e077cc20cf9db6ff8dad4091ab50cb3;hp=3c336c17bd0939c7b36460194b1a831b76a3972d;hpb=879063d7deb100035d21ff2be57dce8d090b431f;p=plack-app-gruntmaster.git diff --git a/lib/Gruntmaster/Page/Ct/Entry.pm b/lib/Gruntmaster/Page/Ct/Entry.pm index 3c336c1..bba2991 100644 --- a/lib/Gruntmaster/Page/Ct/Entry.pm +++ b/lib/Gruntmaster/Page/Ct/Entry.pm @@ -7,14 +7,12 @@ use parent qw/Exporter/; our @EXPORT_OK = qw/generate/; our $VERSION = '0.001'; -use constant TITLE => ''; - 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/; -my %templates = ( +my %orig_templates = ( en => <<'HTML', Contest start time:
Contest end time:

@@ -25,10 +23,10 @@ Contest end time:

HTML ); -$templates{$_} = header($_, TITLE) . $templates{$_} for keys %templates; -$templates{$_} .= footer $_ for keys %templates; +my %templates = cook_templates %orig_templates, ct_entry => ''; sub generate{ + %templates = cook_templates %orig_templates, ct_entry => '' if reload_templates; my ($path, $lang) = @_; $path = ($path =~ m,ct/(.*)/index,)[0]; my $template = $templates{$lang};