X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;ds=sidebyside;f=lib%2FGruntmaster%2FPage%2FLog%2FEntry.pm;h=8fed9a19fb6aa3b28730a900c07d088ef511eb19;hb=2b0036ac8e077cc20cf9db6ff8dad4091ab50cb3;hp=309660a3065155f55f701790a18431c6b78e7c80;hpb=cd9af27e94244e6454c3db787a8ca6811f44fc16;p=plack-app-gruntmaster.git diff --git a/lib/Gruntmaster/Page/Log/Entry.pm b/lib/Gruntmaster/Page/Log/Entry.pm index 309660a..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,11 +24,11 @@ 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{ - $_[0] =~ m,^(?:ct/([^/]+)/)?log/([^/]+)/index\.html$,; + %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;