Skip to content

Commit 4d5a8af

Browse files
Highlight whole team name column for categories
1 parent 54427fa commit 4d5a8af

File tree

2 files changed

+24
-23
lines changed

2 files changed

+24
-23
lines changed

webapp/public/js/domjudge.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -443,10 +443,11 @@ function initFavouriteTeams()
443443
}
444444
}
445445
scoreboard[j].style.background = "lightyellow";
446-
const scoretn = scoreboard[j].querySelector('.scoretn');
447-
if (scoretn && scoretn.classList.contains('cl_FFFFFF')) {
448-
scoretn.classList.remove('cl_FFFFFF');
449-
scoretn.classList.add('cl_FFFFE0');
446+
const whiteCells = scoreboard[j].querySelectorAll('.cl_FFFFFF');
447+
for (let k = 0; k < whiteCells.length; k++) {
448+
const whiteCell = whiteCells[k];
449+
whiteCell.classList.remove('cl_FFFFFF');
450+
whiteCell.classList.add('cl_FFFFE0');
450451
}
451452
if (mobile) {
452453
scoreboard[j + 1].style.background = "lightyellow";

webapp/templates/partials/scoreboard_table.html.twig

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,14 @@
162162
{% set previousTeam = score.team %}
163163
</td>
164164
{% endif %}
165-
<td class="scoreaf">
165+
{% if color is null %}
166+
{% set color = "#FFFFFF" %}
167+
{% set colorClass = "_FFFFFF" %}
168+
{% else %}
169+
{% set colorClass = color | replace({"#": "_"}) %}
170+
{% set backgroundColors = backgroundColors | merge({(color): 1}) %}
171+
{% endif %}
172+
<td class="scoreaf cl{{ colorClass }}">
166173
{% if showFlags %}
167174
{% if score.team.affiliation %}
168175
{% set link = null %}
@@ -176,7 +183,7 @@
176183
{% endif %}
177184
</td>
178185
{% if showAffiliationLogos %}
179-
<td class="scoreaf">
186+
<td class="scoreaf cl{{ colorClass }}">
180187
{% if score.team.affiliation %}
181188
{% set link = null %}
182189
{% if jury %}
@@ -197,14 +204,7 @@
197204
</td>
198205
{% endif %}
199206
{% if public %}
200-
<td class="scoreaf heart"></td>
201-
{% endif %}
202-
{% if color is null %}
203-
{% set color = "#FFFFFF" %}
204-
{% set colorClass = "_FFFFFF" %}
205-
{% else %}
206-
{% set colorClass = color | replace({"#": "_"}) %}
207-
{% set backgroundColors = backgroundColors | merge({(color): 1}) %}
207+
<td class="scoreaf heart cl{{ colorClass }}"></td>
208208
{% endif %}
209209
<td class="scoretn cl{{ colorClass }}" title="{{ score.team.effectiveName }}">
210210
{% set link = null %}
@@ -411,7 +411,13 @@
411411
{% endif %}
412412
</td>
413413
{% endif %}
414-
<td class="scoreaf">
414+
{% if color is null %}
415+
{% set color = "#FFFFFF" %}
416+
{% set colorClass = "_FFFFFF" %}
417+
{% else %}
418+
{% set colorClass = color | replace({"#": "_"}) %}
419+
{% endif %}
420+
<td class="scoreaf cl{{ colorClass }}">
415421
{% if showFlags %}
416422
{% if score.team.affiliation %}
417423
{% set link = null %}
@@ -425,7 +431,7 @@
425431
{% endif %}
426432
</td>
427433
{% if showAffiliationLogos %}
428-
<td class="scoreaf">
434+
<td class="scoreaf cl{{ colorClass }}">
429435
{% if score.team.affiliation %}
430436
{% set link = null %}
431437
{% if jury %}
@@ -446,13 +452,7 @@
446452
</td>
447453
{% endif %}
448454
{% if public %}
449-
<td class="scoreaf heart"></td>
450-
{% endif %}
451-
{% if color is null %}
452-
{% set color = "#FFFFFF" %}
453-
{% set colorClass = "_FFFFFF" %}
454-
{% else %}
455-
{% set colorClass = color | replace({"#": "_"}) %}
455+
<td class="scoreaf heart cl{{ colorClass }}"></td>
456456
{% endif %}
457457
<td class="scoretn cl{{ colorClass }}" title="{{ score.team.effectiveName }}">
458458
{% set link = null %}

0 commit comments

Comments
 (0)