X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FPage%2FPb.pm;fp=lib%2FGruntmaster%2FPage%2FPb.pm;h=18b47bf894710cb8449ba68910592c7a1a266004;hb=2b0036ac8e077cc20cf9db6ff8dad4091ab50cb3;hp=5ada0e22b8a5ad07175140b570a299d33384cdb1;hpb=879063d7deb100035d21ff2be57dce8d090b431f;p=plack-app-gruntmaster.git diff --git a/lib/Gruntmaster/Page/Pb.pm b/lib/Gruntmaster/Page/Pb.pm index 5ada0e2..18b47bf 100644 --- a/lib/Gruntmaster/Page/Pb.pm +++ b/lib/Gruntmaster/Page/Pb.pm @@ -7,16 +7,14 @@ use parent qw/Exporter/; our @EXPORT_OK = qw/generate/; our $VERSION = '0.001'; -use constant TITLE => 'Problems'; - use Fcntl qw/:flock/; use HTML::Template::Compiled; use IO::File; use POSIX qw/strftime/; -use Gruntmaster::Page::Common qw/header footer/; +use Gruntmaster::Page::Common qw/cook_templates reload_templates/; use Gruntmaster::Data qw/problem_name problem_level problems/; -my %templates = ( +my %orig_templates = ( en => <<'HTML',

Beginner

@@ -47,10 +45,10 @@ my %templates = ( HTML ); -$templates{$_} = header($_, TITLE) . $templates{$_} for keys %templates; -$templates{$_} .= footer $_ for keys %templates; +my %templates = cook_templates %orig_templates, pb => 'Problems'; sub generate{ + %templates = cook_templates %orig_templates, pb => 'Problems' if reload_templates; $_[0] =~ m,^(?:ct/([^/]+)/)?pb/index.html$,; local $Gruntmaster::Data::contest = $1;