package Gruntmaster::Page::Ct::Entry;

use 5.014000;
use strict;
use warnings;
use Gruntmaster::Page::Base ct_entry => '<tmpl_var name>';
our @ISA = qw/Gruntmaster::Page::Base/;
our $VERSION = '0.001';

use constant 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="log/st.var">Standings</a></tmpl_if>
HTML
};

sub _generate{
	my ($self, $htc, $path, $lang) = @_;

	$path = ($path =~ m,ct/(.*)/index,)[0];

	$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);
}

1
