}
sub HTML::Element::fid { shift->look_down(id => shift) }
-sub HTML::Element::fclass { shift->look_down(class => shift) }
+sub HTML::Element::fclass { shift->look_down(class => qr/\b$_[0]\b/) }
sub HTML::Element::namedlink {
my ($self, $id, $name) = @_;
stop => ftime $args{stop},
status => $status,
description => literal $args{description});
+ $tree->fid('ctcountdown')->detach if $args{time} >= $args{stop};
}
sub process_ct {
$tree->fid('solution_modal')->fclass('modal-body')->replace_content(literal $args{solution});
}
if ($args{cansubmit}) {
+ $tree->fid('nosubmit')->detach;
$tree->look_down(name => 'problem')->attr(value => $args{id});
my $contest = $tree->look_down(name => 'contest');
$contest->attr(value => $args{contest}) if $args{contest};
$contest->detach unless $args{contest}
} else {
+ $tree->fid('nosubmit')->find('a')->edit_href(sub{s/id/$args{id}/});
$tree->fid('submit')->detach
}
}
$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 {
next unless $elem;
delete $args{args}{page};
my $str = join '&', map { $_ . '=' . $args{args}{$_} } keys %{$args{args}};
- $elem->find('a')->edit_href(sub{s/$/&$str/});
+ $elem->find('a')->edit_href(sub{s/$/&$str/}) if $str;
}
$tree->fclass('current')->replace_content("Page $args{current_page} of $args{last_page}");
}