X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FPage%2FLog%2FEntry.pm;fp=lib%2FGruntmaster%2FPage%2FLog%2FEntry.pm;h=8fed9a19fb6aa3b28730a900c07d088ef511eb19;hb=2b0036ac8e077cc20cf9db6ff8dad4091ab50cb3;hp=3e9e08fed2f2d8762a93a62f87ab6cdf07ccde26;hpb=879063d7deb100035d21ff2be57dce8d090b431f;p=plack-app-gruntmaster.git diff --git a/lib/Gruntmaster/Page/Log/Entry.pm b/lib/Gruntmaster/Page/Log/Entry.pm index 3e9e08f..8fed9a1 100644 --- a/lib/Gruntmaster/Page/Log/Entry.pm +++ b/lib/Gruntmaster/Page/Log/Entry.pm @@ -7,14 +7,12 @@ use parent qw/Exporter/; our @EXPORT_OK = qw/generate/; our $VERSION = '0.001'; -use constant TITLE => 'Job '; - 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/job_results/; -my %templates = ( +my %orig_templates = ( en => <<'HTML', @@ -26,10 +24,10 @@ my %templates = ( HTML ); -$templates{$_} = header($_, TITLE) . $templates{$_} for keys %templates; -$templates{$_} .= footer $_ for keys %templates; +my %templates = cook_templates %orig_templates, log_entry => 'Job '; sub generate{ + %templates = cook_templates %orig_templates, log_entry => 'Job ' if reload_templates; $_[0] =~ m,^(?:ct/([^/]+)/)?log/job/([^/]+)\.html$,; local $Gruntmaster::Data::contest = $1; my $id = $2;