Skip to content

Commit 945d246

Browse files
committed
Add background color to the pre-contest page.
1 parent 14023ca commit 945d246

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

webapp/src/Service/ScoreboardService.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,7 @@ public function getGroupedAffiliations(Contest $contest): array
780780
'id' => $teamaffil->getExternalid(),
781781
'name' => $teamaffil->getName(),
782782
'country' => $teamaffil->getCountry(),
783+
'color' => $category->getColor(),
783784
];
784785
}
785786
}

webapp/templates/partials/scoreboard.html.twig

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,13 @@
6767
<div class="card-body">
6868
<ul class="list-group list-group-flush">
6969
{% for affiliation in affiliations %}
70-
<li class="list-group-item">
70+
{% if affiliation.color is null %}
71+
{% set color = "#FFFFFF" %}
72+
{% set colorClass = "_FFFFFF" %}
73+
{% else %}
74+
{% set colorClass = affiliation.color | replace({"#": "_"}) %}
75+
{% endif %}
76+
<li class="list-group-item cl{{ colorClass }}">
7177
{% if showFlags %}
7278
{{ affiliation.country|countryFlag }}
7379
{% endif %}

0 commit comments

Comments
 (0)