+ if ($args{limits}) {
+ my @limits = (@{$args{limits}}, {format => 'Other', timeout => $args{timeout} });
+ @limits = map { sprintf '%s (%s)', @{$_}{qw/timeout format/} } @limits;
+ $tree->look_down(smap => 'timeout')->replace_content(join ', ', @limits);
+ }
+ if ($args{contest_stop}) {
+ $tree->fid('solution')->detach;
+ $tree->fid('solution_modal')->detach;
+ my $score = $tree->fid('score');
+ $score->attr('data-start' => $args{open_time});
+ $score->attr('data-stop' => $args{contest_stop});
+ $score->attr('data-value' => $args{value});
+ $tree->fid('countdown')->attr('data-stop' => $args{contest_stop});
+ } else {
+ $tree->fid('job_log')->edit_href(sub{$_ .= "&private=$args{private}"}) if $args{private};
+ $tree->fid('solution')->detach unless $args{solution};
+ $_->detach for $tree->fclass('rc'); # requires contest
+ $tree->fid('solution_modal')->fclass('modal-body')->replace_content(literal $args{solution});
+ }