From: Marius Gavrilescu Date: Sun, 4 Jan 2015 15:19:35 +0000 (+0200) Subject: Improve log_entry X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=435a869c1448a9beb087b6ad48c72a8cf23fba6b;p=gruntmaster-page.git Improve log_entry --- diff --git a/lib/Plack/App/Gruntmaster/HTML.pm b/lib/Plack/App/Gruntmaster/HTML.pm index f0952cf..5505a39 100644 --- a/lib/Plack/App/Gruntmaster/HTML.pm +++ b/lib/Plack/App/Gruntmaster/HTML.pm @@ -192,6 +192,17 @@ sub process_pb { sub process_log_entry { my ($tree, %args) = @_; + $tree->fid('problem')->namedlink(@args{qw/problem problem_name/}); + $tree->fid('owner')->namedlink(@args{qw/owner owner_name/}); + $tree->fid('source')->namedlink("$args{id}.$args{extension}", sprintf '%.2fKB', $args{size}/1024); + if ($args{contest}) { + $tree->fid('contest')->namedlink(@args{qw/contest contest_name/}); + $tree->fid('problem')->find('a')->edit_href(sub {$_.="?contest=$args{contest}"}); + } else { + $tree->fid('contest')->left->detach; + $tree->fid('contest')->detach; + } + $args{errors} ? $tree->fid('errors')->find('pre')->replace_content($args{errors}) : $tree->fid('errors')->detach; my $iter = sub { my ($data, $tr) = @_; @@ -199,7 +210,7 @@ sub process_log_entry { $tr->defmap(class => $data); $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; + $args{results} ? $tree->fid('results')->find('tbody')->find('tr')->iter3($args{results}, $iter) : $tree->fid('results')->detach; } sub process_log { diff --git a/tmpl/log_entry.en b/tmpl/log_entry.en index eb05db8..cb00e33 100644 --- a/tmpl/log_entry.en +++ b/tmpl/log_entry.en @@ -1,3 +1,9 @@ +
+
Owner
owner
+
Problem
problem
+
Contest
contest
+
Source
1.55 KB
+

Compiler output