use warnings NONFATAL => 'all';
no warnings 'illegalproto';
- no if $] >= 5.017011, warnings => 'experimental::smartmatch';
##################################################
pas => 'text/x-pascal',
pl => 'text/x-perl',
py => 'text/x-python',
+ l => 'text/plain',
};
use constant FORMAT_EXTENSION => {
sub (/ed/:contest) {
forbid contest->is_running;
- response ed => 'Editorial of ' . contest->name, db->problem_list(contest => $_{contest}, solution => 1);
+ my $pblist = db->problem_list(contest => $_{contest}, solution => 1);
+ response ed => 'Editorial of ' . contest->name, {%$pblist, editorial => contest->editorial};
},
sub (/login) {
sub process_skel {
my ($tree, %args) = @_;
+ $tree->fid('logo')->replace_with(literal scalar read_file "mclogo.svg");
$tree->content_handler(
title => $args{title},
content => literal $args{meat});
sub process_ct_entry {
my ($tree, %args) = @_;
$_->edit_href (sub {s/contest_id/$args{id}/}) for $tree->find('a');
+ $tree->fid('editorial')->detach unless $args{finished};
$tree->fid('links')->detach unless $args{started};
my $status = ($args{time} < $args{start} ? 'starts' : 'ends');
$tree->fclass('timer')->attr('data-stop', $status eq 'ends' ? $args{stop} : $args{start});
$div->find('tbody')->find('tr')->iter3($args{$data}, $titer);
};
$tree->fid('beginner')->iter3([grep {$args{$_}} qw/beginner easy medium hard/], $iter);
+ $tree->fid('open-alert')->detach unless $args{contest};
}
sub process_log_entry {
sub process_ed {
my ($tree, %args) = @_;
+ $tree->content_handler(editorial => literal $args{editorial});
my $iter = sub {
my ($data, $div) = @_;
$div->set_child_content(class => 'value', $data->{value});