General standings should not list problems
authorMarius Gavrilescu <marius@ieval.ro>
Tue, 28 Jan 2014 13:01:59 +0000 (15:01 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Tue, 28 Jan 2014 13:01:59 +0000 (15:01 +0200)
lib/Gruntmaster/Page/St.pm

index b91137e883f2f45cfea0933b3ed58db83970994a..b50490c00f3e31d6d22382c45b5003148373d6cc 100644 (file)
@@ -11,11 +11,14 @@ use constant TEMPLATES => {
        en => <<'HTML',
 <table border>
 <thead>
-<tr><th>Username<tmpl_loop problems><th><tmpl_var _></tmpl_loop><th>Total
+<tmpl_if problems><tr><th>Username<tmpl_loop problems><th><tmpl_var _></tmpl_loop><th>Total
+<tmpl_else><tr><th>Username<th>Score
+</tmpl_if>
+
 <tbody>
 <tmpl_loop st><tr><td><tmpl_var user>
-<tmpl_loop scores><td><tmpl_var _>
-</tmpl_loop><td><tmpl_var score>
+<tmpl_if problems><tmpl_loop scores><td><tmpl_var _>
+</tmpl_loop></tmpl_if><td><tmpl_var score>
 </tmpl_loop>
 </table>
 HTML
@@ -46,7 +49,7 @@ sub _generate{
                        scores => [map { $scores{$user}{$_} // '-'} @problems],
                }
        } keys %scores;
-       $htc->param(problems => [map { problem_name } @problems ]);
+       $htc->param(problems => [map { problem_name } @problems ]) if $Gruntmaster::Data::contest;
        $htc->param(st => \@st);
 }
 
This page took 0.01104 seconds and 4 git commands to generate.