-use constant TITLE => '<tmpl_var name>';
-
-my %templates = (
- en => <<'HTML',
-Contest start time: <tmpl_var start><br>
-Contest end time: <tmpl_var end><p>
-
-<tmpl_if started><a href="pb/">Problems</a><br>
-<a href="log/">Job log</a><br>
-<a href="st/">Standings</a></tmpl_if>
-HTML
-);
-
-$templates{$_} = header($_, TITLE) . $templates{$_} for keys %templates;
-$templates{$_} .= footer $_ for keys %templates;
-
-sub generate{
- my ($path, $lang) = @_;
- $path = ($path =~ m,ct/(.*)/index,)[0];
- my $template = $templates{$lang};
- my $htc = HTML::Template::Compiled->new(scalarref => \$template);
- flock my $metafh = IO::File->new("<ct/$path/meta.yml"), LOCK_SH;
- my $meta = LoadFile "ct/$path/meta.yml";
-
- $htc->param(id => $path);
- $htc->param(name => $meta->{name});
- $htc->param(start => strftime '%c', localtime $meta->{start});
- $htc->param(end => strftime '%c', localtime $meta->{end});
- $htc->param(started => time >= $meta->{start});
- $htc->output
+ $htc->param(id => $id);
+ $htc->param(name => contest_name $id);
+ $htc->param(start => strftime '%c', localtime contest_start $id);
+ $htc->param(end => strftime '%c', localtime contest_end $id);
+ $htc->param(started => time >= contest_start $id);