X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FPage%2FAccount.pm;h=20acc6ab30e6731f6f0786acd3d18edb8915426c;hb=4aa8ba862bf3a79362df73c3d1e8707e8135af23;hp=6842b121914304b8b5b0420de665d52804fd6f79;hpb=088a8d629e11c01e227ca2dc0c80894f1e1db997;p=plack-app-gruntmaster.git diff --git a/lib/Gruntmaster/Page/Account.pm b/lib/Gruntmaster/Page/Account.pm index 6842b12..20acc6a 100644 --- a/lib/Gruntmaster/Page/Account.pm +++ b/lib/Gruntmaster/Page/Account.pm @@ -7,12 +7,10 @@ use parent qw/Exporter/; our @EXPORT_OK = qw/generate/; our $VERSION = '0.001'; -use constant TITLE => 'Account'; - use HTML::Template::Compiled; -use Gruntmaster::Page::Common qw/header footer/; +use Gruntmaster::Page::Common qw/cook_templates reload_templates/; -my %templates = ( +my %orig_templates = ( en => <<'HTML',
@@ -48,10 +46,10 @@ Confirm new password:
HTML ); -$templates{$_} = header($_, TITLE) . $templates{$_} for keys %templates; -$templates{$_} .= footer $_ for keys %templates; +my %templates = cook_templates %orig_templates, account => 'Account'; sub generate{ + %templates = cook_templates %orig_templates, account => 'Account' if reload_templates; HTML::Template::Compiled->new(scalarref => \$templates{$_[1]})->output }