Skip to content

Commit b32fc5c

Browse files
Fix pre-contest display when teams have no affiliations
1 parent 9aec964 commit b32fc5c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

webapp/src/Service/ScoreboardService.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,8 @@ public function getGroupedAffiliations(Contest $contest): array
750750
->leftJoin('t.affiliation', 'affil')
751751
->andWhere('cat.visible = 1')
752752
->orderBy('cat.name')
753-
->addOrderBy('affil.name');
753+
->addOrderBy('affil.name')
754+
->addOrderBy('t.name');
754755

755756
if (!$contest->isOpenToAllTeams()) {
756757
$queryBuilder

webapp/templates/partials/scoreboard.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@
6767
<div class="card-body">
6868
<ul class="list-group list-group-flush">
6969
{% for affiliation in affiliations %}
70-
{% if affiliation.color is null %}
70+
{% if affiliation.color is not defined or affiliation.color is null %}
7171
{% set color = "#FFFFFF" %}
7272
{% set colorClass = "_FFFFFF" %}
7373
{% else %}
7474
{% set colorClass = affiliation.color | replace({"#": "_"}) %}
7575
{% endif %}
7676
<li class="list-group-item cl{{ colorClass }}">
77-
{% if showFlags %}
77+
{% if showFlags and affiliation.country is defined %}
7878
{{ affiliation.country|countryFlag }}
7979
{% endif %}
8080
{% set affiliationLogo = affiliation.id | assetPath('affiliation') %}

0 commit comments

Comments
 (0)