]> iEval git - plack-app-gruntmaster.git/blobdiff - lib/Plack/App/Gruntmaster/HTML.pm
Use open_time instead of contest_start in problem timer
[plack-app-gruntmaster.git] / lib / Plack / App / Gruntmaster / HTML.pm
index 5505a3917973f1f7991b4f691433018b68a521aa..a4c6da16782fa8004baa9288daba83271f4a72bf 100644 (file)
@@ -138,25 +138,28 @@ sub process_pb_entry {
        $tree->fid('owner')->edit_href(sub{s/owner_id/$args{owner}/});
        $tree->fid('job_log')->edit_href(sub{s/problem_id/$args{id}/});
        $tree->fid('solution')->edit_href(sub{s/problem_id/$args{id}/});
+       $tree->fid('job_log')->edit_href(sub{$_ .= "&private=$args{private}"}) if $args{private};
        $tree->content_handler(
                statement => literal $args{statement},
+               level     => ucfirst $args{level},
                author    =>         $args{author},
                owner     =>         $args{owner_name} || $args{owner});
        if ($args{contest_stop}) {
                $tree->fid('solution')->detach;
                $tree->fid('solution_modal')->detach;
                my $countdown = $tree->fid('countdown');
-               $countdown->attr('data-start' => $args{contest_start});
+               $countdown->attr('data-start' => $args{open_time});
                $countdown->attr('data-stop' => $args{contest_stop});
                $countdown->attr('data-time' => $args{time});
                my $left = $args{contest_stop} - $args{time};
                $countdown->replace_content(sprintf '%02d:%02d:%02d', $left/60/60, $left/60%60, $left%60);
                $tree->fid('score')->attr('data-value' => $args{value});
-               $tree->fid('score')->replace_content(Gruntmaster::Data::calc_score($args{value}, $args{time} - $args{contest_start}, 0, $args{contest_stop} - $args{contest_start}));
+               $tree->fid('score')->replace_content(Gruntmaster::Data::calc_score($args{value}, $args{time} - $args{open_time}, 0, $args{contest_stop} - $args{contest_start}));
        } else {
                $_->detach for $tree->fclass('rc'); # requires contest
                $tree->fid('solution_modal')->fclass('modal-body')->replace_content(literal $args{solution});
        }
+       $tree->fid('solution')->detach unless $args{solution};
        if ($args{cansubmit}) {
                $tree->look_down(name => 'problem')->attr(value => $args{id});
                my $contest = $tree->look_down(name => 'contest');
This page took 0.023863 seconds and 4 git commands to generate.