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=6266661e39c288d4112c2a5c475ec87224968857;hb=bb95f538bf263c0294d87cfb90d58c66117b9aab;hp=bba2991c6e8a13d5fbeebbd473cbd440cb2806a4;hpb=4aa8ba862bf3a79362df73c3d1e8707e8135af23;p=plack-app-gruntmaster.git diff --git a/lib/Gruntmaster/Page/Ct/Entry.pm b/lib/Gruntmaster/Page/Ct/Entry.pm index bba2991..6266661 100644 --- a/lib/Gruntmaster/Page/Ct/Entry.pm +++ b/lib/Gruntmaster/Page/Ct/Entry.pm @@ -3,16 +3,11 @@ package Gruntmaster::Page::Ct::Entry; use 5.014000; use strict; use warnings; -use parent qw/Exporter/; -our @EXPORT_OK = qw/generate/; +use Gruntmaster::Page::Base ct_entry => ''; +our @ISA = qw/Gruntmaster::Page::Base/; our $VERSION = '0.001'; -use HTML::Template::Compiled; -use POSIX qw/strftime/; -use Gruntmaster::Page::Common qw/cook_templates reload_templates/; -use Gruntmaster::Data qw/contest_name contest_start contest_end/; - -my %orig_templates = ( +use constant TEMPLATES => { en => <<'HTML', Contest start time:
Contest end time:

@@ -21,23 +16,18 @@ Contest end time:

Job log
Standings HTML -); +}; -my %templates = cook_templates %orig_templates, ct_entry => ''; +sub _generate{ + my ($self, $htc, $path, $lang) = @_; -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}; - my $htc = HTML::Template::Compiled->new(scalarref => \$template); $htc->param(id => $path); $htc->param(name => contest_name $path); $htc->param(start => strftime '%c', contest_start); $htc->param(end => strftime '%c', contest_end); $htc->param(started => time >= contest_start); - $htc->output } 1