Skip to content

Commit 4f6b3ec

Browse files
Update mobile scoreboard.
- Make team names not fall of the screen by calculating their max width. - Make non mobile scoreboard not left-aligned. - Add a bit of margin to the header. - Make the problem boxes right aligned. - Change the card at the top to show 2 lines (name + contestt time) on mobile.
1 parent b93d0ad commit 4f6b3ec

File tree

3 files changed

+33
-25
lines changed

3 files changed

+33
-25
lines changed

webapp/public/style_domjudge.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ del {
219219
display: block;
220220
overflow: hidden;
221221
}
222+
222223
.toolong:after {
223224
content: "";
224225
width: 30%;
@@ -719,4 +720,4 @@ blockquote {
719720
-ms-transform:rotate(-35deg);
720721
-o-transform:rotate(-35deg);
721722
transform:rotate(-35deg);
722-
}
723+
}

webapp/templates/partials/scoreboard.html.twig

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,37 @@
1818
{% endif %}
1919

2020
<div class="card" {% if refreshstop is defined %}data-ajax-refresh-stop="1"{% endif %}>
21-
<div class="card-header" style="font-family: Roboto, sans-serif; display: flex;">
22-
<span style="font-weight: bold;">{{ current_contest.name }}</span>
23-
<span id="contesttimer">
24-
{% if scoreboard is null %}
25-
{{ current_contest | printContestStart }}
26-
{% elseif scoreboard.freezeData.showFinal(jury) %}
27-
{% if current_contest.finalizetime is empty %}
28-
preliminary results - not final
29-
{% else %}
30-
final standings
31-
{% endif %}
32-
{% elseif scoreboard.freezeData.stopped %}
33-
contest over, waiting for results
34-
{% elseif static %}
35-
{% set now = 'now'|date('U') %}
36-
{{ current_contest.starttime | printelapsedminutes(now) }}
37-
{% else %}
38-
{% if current_contest.freezeData.started %}
39-
started:
21+
<div class="card-header" style="font-family: Roboto, sans-serif;">
22+
<div class="row">
23+
<div class="col-md-6 col-12">
24+
<span style="font-weight: bold;">{{ current_contest.name }}</span>
25+
</div>
26+
<div class="col-md-6 col-12 text-md-end text-start">
27+
<span id="contesttimer">
28+
{% if scoreboard is null %}
29+
{{ current_contest | printContestStart }}
30+
{% elseif scoreboard.freezeData.showFinal(jury) %}
31+
{% if current_contest.finalizetime is empty %}
32+
preliminary results - not final
33+
{% else %}
34+
final standings
35+
{% endif %}
36+
{% elseif scoreboard.freezeData.stopped %}
37+
contest over, waiting for results
38+
{% elseif static %}
39+
{% set now = 'now'|date('U') %}
40+
{{ current_contest.starttime | printelapsedminutes(now) }}
4041
{% else %}
41-
starts:
42+
{% if current_contest.freezeData.started %}
43+
started:
44+
{% else %}
45+
starts:
46+
{% endif %}
47+
{{ current_contest.starttime | printtime }} - ends: {{ current_contest.endtime | printtime }}
4248
{% endif %}
43-
{{ current_contest.starttime | printtime }} - ends: {{ current_contest.endtime | printtime }}
44-
{% endif %}
45-
</span>
49+
</span>
50+
</div>
51+
</div>
4652
</div>
4753

4854
{% if static %}

webapp/templates/public/scoreboard.html.twig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
{% set bannerImage = globalBannerAssetPath() %}
1313
{% endif %}
1414
{% if bannerImage %}
15-
<img class="banner" src="{{ asset(bannerImage) }}" alt="Banner">
15+
<img class="banner mt-2" src="{{ asset(bannerImage) }}" alt="Banner">
1616
{% endif %}
1717

1818
<div data-ajax-refresh-target data-ajax-refresh-after="initializeScoreboard" class="mt-3">
@@ -53,6 +53,7 @@
5353
{% if static and refresh is defined %}
5454
disableRefreshOnModal();
5555
{% endif %}
56+
resizeMobileTeamNames();
5657
};
5758
5859
{% if static and refresh is defined %}

0 commit comments

Comments
 (0)