Skip to content

Commit 38447d5

Browse files
Disable ranking on mobile scoreboard when requested
1 parent 5e51d81 commit 38447d5

File tree

1 file changed

+33
-21
lines changed

1 file changed

+33
-21
lines changed

webapp/templates/partials/scoreboard_table.html.twig

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,9 @@
320320
<thead>
321321
{# output table column groups (for the styles) #}
322322
<colgroup>
323-
<col id="scorerank"/>
323+
{% if enable_ranking %}
324+
<col id="scorerank"/>
325+
{% endif %}
324326
{% if showFlags %}
325327
<col id="scoreflags"/>
326328
{% else %}
@@ -331,19 +333,25 @@
331333
{% endif %}
332334
<col id="scoreteamname"/>
333335
</colgroup>
334-
<colgroup>
335-
<col id="scoresolv"/>
336-
</colgroup>
336+
{% if enable_ranking %}
337+
<colgroup>
338+
<col id="scoresolv"/>
339+
</colgroup>
340+
{% endif %}
337341
338342
{% set teamColspan = 2 %}
339343
{% if showAffiliationLogos %}
340344
{% set teamColspan = teamColspan + 1 %}
341345
{% endif %}
342346
343347
<tr class="scoreheader" data-static="{{ static }}" style="font-size: 75%;">
344-
<th title="rank" scope="col">rank</th>
348+
{% if enable_ranking %}
349+
<th title="rank" scope="col">rank</th>
350+
{% endif %}
345351
<th title="team name" scope="col" colspan="{{ teamColspan }}">team</th>
346-
<th title="# solved / penalty time" colspan="1" scope="col">score</th>
352+
{% if enable_ranking %}
353+
<th title="# solved / penalty time" colspan="1" scope="col">score</th>
354+
{% endif %}
347355
</tr>
348356
</thead>
349357
<tbody>
@@ -373,16 +381,18 @@
373381
{% set color = score.team.category.color %}
374382
{% endif %}
375383
<tr class="{{ classes | join(' ') }}" id="team:{{ score.team.teamid }}" style="border-bottom-width: 0; height: 28px;">
376-
<td class="scorepl {{medalColor}}" rowspan="2">
377-
{# Only print rank when score is different from the previous team #}
378-
{% if not displayRank %}
379-
?
380-
{% elseif previousTeam is null or scoreboard.scores[previousTeam.teamid].rank != score.rank %}
381-
{{ score.rank }}
382-
{% else %}
383-
{% endif %}
384-
{% set previousTeam = score.team %}
385-
</td>
384+
{% if enable_ranking %}
385+
<td class="scorepl {{medalColor}}" rowspan="2">
386+
{# Only print rank when score is different from the previous team #}
387+
{% if not displayRank %}
388+
?
389+
{% elseif previousTeam is null or scoreboard.scores[previousTeam.teamid].rank != score.rank %}
390+
{{ score.rank }}
391+
{% else %}
392+
{% endif %}
393+
{% set previousTeam = score.team %}
394+
</td>
395+
{% endif %}
386396
<td class="scoreaf">
387397
{% if showFlags %}
388398
{% if score.team.affiliation %}
@@ -459,12 +469,14 @@
459469
{% endif %}
460470
</a>
461471
</td>
462-
{% set totalTime = score.totalTime %}
463-
{% if scoreInSeconds %}
464-
{% set totalTime = totalTime | printTimeRelative %}
472+
{% if enable_ranking %}
473+
{% set totalTime = score.totalTime %}
474+
{% if scoreInSeconds %}
475+
{% set totalTime = totalTime | printTimeRelative %}
476+
{% endif %}
477+
{% set totalPoints = score.numPoints %}
478+
<td class="scorenc" rowspan="2">{{ totalPoints }}<br/><span class="scorett" style="font-weight: normal;">{{ totalTime }}</span></td>
465479
{% endif %}
466-
{% set totalPoints = score.numPoints %}
467-
<td class="scorenc" rowspan="2">{{ totalPoints }}<br/><span class="scorett" style="font-weight: normal;">{{ totalTime }}</span></td>
468480
</tr>
469481
<tr style="height: 32px;">
470482
<td class="no-border"/>

0 commit comments

Comments
 (0)