our @EXPORT_OK = qw/generate/;
our $VERSION = '0.001';
-use constant TITLE => 'Standings';
-
use HTML::Template::Compiled;
use List::Util qw/sum/;
use POSIX qw/strftime/;
-use Gruntmaster::Page::Common qw/header footer/;
+use Gruntmaster::Page::Common qw/cook_templates reload_templates/;
use Gruntmaster::Data qw/problems jobcard job_result_text job_result job_problem job_user/;
-my %templates = (
+my %orig_templates = (
en => <<'HTML',
<table border>
<thead>
HTML
);
-$templates{$_} = header($_, TITLE) . $templates{$_} for keys %templates;
-$templates{$_} .= footer $_ for keys %templates;
+my %templates = cook_templates %orig_templates, st => 'Standings';
sub generate{
+ %templates = cook_templates %orig_templates, st => 'Standings' if reload_templates;
local $Gruntmaster::Data::contest = ($_[0] =~ m,^ct/([^/]+)/,)[0];
my $htc = HTML::Template::Compiled->new(scalarref => \$templates{$_[1]});