X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FPage%2FCt.pm;h=f5c6c1f0d2cc9ed6ee53f83137f3b6bb1a5314c4;hb=f7d696bce1290f0b40dc1ee43f404eff2f71404b;hp=19c4aad33cc319d4504768eb2b7fc8c30c4ac47a;hpb=cd9af27e94244e6454c3db787a8ca6811f44fc16;p=plack-app-gruntmaster.git diff --git a/lib/Gruntmaster/Page/Ct.pm b/lib/Gruntmaster/Page/Ct.pm index 19c4aad..f5c6c1f 100644 --- a/lib/Gruntmaster/Page/Ct.pm +++ b/lib/Gruntmaster/Page/Ct.pm @@ -3,18 +3,11 @@ package Gruntmaster::Page::Ct; use 5.014000; use strict; use warnings; -use parent qw/Exporter/; -our @EXPORT_OK = qw/generate/; +use Gruntmaster::Page::Base ct => 'Contests'; +our @ISA = qw/Gruntmaster::Page::Base/; our $VERSION = '0.001'; -use constant TITLE => 'Contests'; - -use HTML::Template::Compiled; -use POSIX qw/strftime/; -use Gruntmaster::Page::Common qw/header footer/; -use Gruntmaster::Data qw/contest_name contest_start contest_end contest_owner/; - -my %templates = ( +use constant TEMPLATES => { en => <<'HTML',

Running contests

@@ -58,13 +51,10 @@ my %templates = (
HTML -); - -$templates{$_} = header($_, TITLE) . $templates{$_} for keys %templates; -$templates{$_} .= footer $_ for keys %templates; +}; -sub generate{ - my $htc = HTML::Template::Compiled->new(scalarref => \$templates{$_[1]}); +sub _generate{ + my ($self, $htc, $path, $lang) = @_; my (@running, @pending, @finished); for (contests) { @@ -83,7 +73,6 @@ sub generate{ $htc->param(running => \@running); $htc->param(pending => \@pending); $htc->param(finished => \@finished); - $htc->output } 1