]> iEval git - gruntmaster-page.git/commitdiff
Only show problem values on contest problem lists
authorMarius Gavrilescu <marius@ieval.ro>
Thu, 28 Apr 2016 13:19:55 +0000 (14:19 +0100)
committerMarius Gavrilescu <marius@ieval.ro>
Thu, 28 Apr 2016 13:19:55 +0000 (14:19 +0100)
lib/Plack/App/Gruntmaster/HTML.pm
tmpl/pb.en

index f18e5f65bb107cb7be0ad6a895ec830c8bf9065e..de27579a5a1a2f7cead908df5ec0d86863da515f 100644 (file)
@@ -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};
 }
index 009c46b242a786ed5b49cee510e4b1a9f0359736..6974476eac5b4f59179ebcbfb3b7c1509ee8cf92 100644 (file)
@@ -4,7 +4,7 @@ The timer for a problem starts when you open the problem. You will lose points i
 </div>
 
 <table class="table table-striped table-fixed">
-<thead><tr><th>Name<th>Author<th>Owner<th>Level<th>Value</thead>
+<thead><tr><th>Name<th>Author<th>Owner<th>Level<th class="value">Value</thead>
 
 <tbody>
 <tr><td class="name"><a href="id">Name</a><td class="author">author<td class="owner"><a href="/us/id">Owner name</a><td class="level">Beginner<td class="value">Value
This page took 0.028474 seconds and 4 git commands to generate.