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',
<tmpl_if running>
<h1>Running contests</h1>
</table>
</tmpl_if>
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) {
$htc->param(running => \@running);
$htc->param(pending => \@pending);
$htc->param(finished => \@finished);
- $htc->output
}
1