]> iEval git - gruntmaster-page.git/blobdiff - lib/Plack/App/Gruntmaster/HTML.pm
Show "No results yet" in log_entry when job is not done
[gruntmaster-page.git] / lib / Plack / App / Gruntmaster / HTML.pm
index f2ce142269abbc94f5b1f46951cde1b193c9da18..0ac0c88b6fe17667139cd11983aaf8c751a84985 100644 (file)
@@ -141,19 +141,20 @@ sub process_pb_entry {
        $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});
@@ -213,6 +214,7 @@ sub process_log_entry {
                $tr->fclass('result_text')->attr(class => "r$data->{result}")
        };
        $args{results} ? $tree->fid('results')->find('tbody')->find('tr')->iter3($args{results}, $iter) : $tree->fid('results')->detach;
+       $tree->fid('no_results')->detach if $tree->fid('results') || $tree->fid('errors');
 }
 
 sub process_log {
This page took 0.018918 seconds and 4 git commands to generate.