From e85f5f172aa05e8fd509e2fad2ace9b2375719d2 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Thu, 28 Apr 2016 14:19:55 +0100 Subject: [PATCH] Only show problem values on contest problem lists --- lib/Plack/App/Gruntmaster/HTML.pm | 5 ++++- tmpl/pb.en | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Plack/App/Gruntmaster/HTML.pm b/lib/Plack/App/Gruntmaster/HTML.pm index f18e5f6..de27579 100644 --- a/lib/Plack/App/Gruntmaster/HTML.pm +++ b/lib/Plack/App/Gruntmaster/HTML.pm @@ -210,7 +210,8 @@ sub process_pb { my $iter = sub { my ($data, $tr) = @_; $tr->set_child_content(class => 'author', $data->{author}); - $tr->set_child_content(class => 'value', $data->{value}); + $tr->set_child_content(class => 'value', $data->{value}) if $args{args}{contest}; + $tr->fclass('value')->detach unless $args{args}{contest}; $tr->set_child_content(class => 'level', ucfirst $data->{level}); $tr->fclass('name')->namedlink($data->{id}, $data->{name}); $tr->fclass('name')->find('a')->edit_href(sub {$_ .= "?contest=$args{args}{contest}"}) if $args{args}{contest}; @@ -218,6 +219,8 @@ sub process_pb { $tr->find('td')->attr(class => $tr->find('td')->attr('class').' warning') if $data->{private} && !$args{args}{contest}; }; + $tree->find('thead')->fclass('value')->detach unless $args{args}{contest}; + $tree->find('tbody')->find('tr')->iter3([sort { $a->{value} <=> $b->{value} } @{$args{pb}}], $iter); $tree->fid('open-alert')->detach unless $args{args}{contest}; } diff --git a/tmpl/pb.en b/tmpl/pb.en index 009c46b..6974476 100644 --- a/tmpl/pb.en +++ b/tmpl/pb.en @@ -4,7 +4,7 @@ The timer for a problem starts when you open the problem. You will lose points i - +
NameAuthorOwnerLevelValue
NameAuthorOwnerLevelValue
NameauthorOwner nameBeginnerValue -- 2.39.2