From b12ef6653bd9598e77aa3ee0dbd1c92a9aae33c1 Mon Sep 17 00:00:00 2001 From: Michael Vasseur <14887731+vmcj@users.noreply.github.com> Date: Sat, 11 Nov 2023 16:21:23 +0100 Subject: [PATCH 01/20] Use more than 1 width of problems --- example_problems/problems.yaml | 148 +++++++++++++++++++++++++++++++-- 1 file changed, 142 insertions(+), 6 deletions(-) diff --git a/example_problems/problems.yaml b/example_problems/problems.yaml index 99ef34f9d3..058fd7ee8c 100644 --- a/example_problems/problems.yaml +++ b/example_problems/problems.yaml @@ -1,15 +1,151 @@ -- id: hello - label: A +- id: hello0- + label: A0- ordinal: 1 rgb: '#9486EA' time_limit: 5 -- id: fltcmp - label: B +- id: fltcmp0- + label: B0- ordinal: 2 rgb: '#E93603' time_limit: 5 -- id: boolfind - label: C +- id: boolfind0- + label: C0- ordinal: 3 rgb: '#9B630C' time_limit: 5 +- id: hello1- + label: A1- + ordinal: 1 + rgb: '#9486EA' + time_limit: 5 +- id: fltcmp1- + label: B1- + ordinal: 2 + rgb: '#E93603' + time_limit: 5 +- id: boolfind1- + label: C1- + ordinal: 3 + rgb: '#9B630C' + time_limit: 5 +- id: hello2- + label: A2- + ordinal: 1 + rgb: '#9486EA' + time_limit: 5 +- id: fltcmp2- + label: B2- + ordinal: 2 + rgb: '#E93603' + time_limit: 5 +- id: boolfind2- + label: C2- + ordinal: 3 + rgb: '#9B630C' + time_limit: 5 +- id: hello3- + label: A3- + ordinal: 1 + rgb: '#9486EA' + time_limit: 5 +- id: fltcmp3- + label: B3- + ordinal: 2 + rgb: '#E93603' + time_limit: 5 +- id: boolfind3- + label: C3- + ordinal: 3 + rgb: '#9B630C' + time_limit: 5 +- id: hello4- + label: A4- + ordinal: 1 + rgb: '#9486EA' + time_limit: 5 +- id: fltcmp4- + label: B4- + ordinal: 2 + rgb: '#E93603' + time_limit: 5 +- id: boolfind4- + label: C4- + ordinal: 3 + rgb: '#9B630C' + time_limit: 5 +- id: hello5- + label: A5- + ordinal: 1 + rgb: '#9486EA' + time_limit: 5 +- id: fltcmp5- + label: B5- + ordinal: 2 + rgb: '#E93603' + time_limit: 5 +- id: boolfind5- + label: C5- + ordinal: 3 + rgb: '#9B630C' + time_limit: 5 +- id: hello6- + label: A6- + ordinal: 1 + rgb: '#9486EA' + time_limit: 5 +- id: fltcmp6- + label: B6- + ordinal: 2 + rgb: '#E93603' + time_limit: 5 +- id: boolfind6- + label: C6- + ordinal: 3 + rgb: '#9B630C' + time_limit: 5 +- id: hello7- + label: A7- + ordinal: 1 + rgb: '#9486EA' + time_limit: 5 +- id: fltcmp7- + label: B7- + ordinal: 2 + rgb: '#E93603' + time_limit: 5 +- id: boolfind7- + label: C7- + ordinal: 3 + rgb: '#9B630C' + time_limit: 5 +- id: hello8- + label: A8- + ordinal: 1 + rgb: '#9486EA' + time_limit: 5 +- id: fltcmp8- + label: B8- + ordinal: 2 + rgb: '#E93603' + time_limit: 5 +- id: boolfind8- + label: C8- + ordinal: 3 + rgb: '#9B630C' + time_limit: 5 +- id: hello9- + label: A9- + ordinal: 1 + rgb: '#9486EA' + time_limit: 5 +- id: fltcmp9- + label: B9- + ordinal: 2 + rgb: '#E93603' + time_limit: 5 +- id: boolfind9- + label: C9- + ordinal: 3 + rgb: '#9B630C' + time_limit: 5 + From 24c5110a6ee479344ba4f3b440ee35fdd08db988 Mon Sep 17 00:00:00 2001 From: Michael Vasseur <14887731+vmcj@users.noreply.github.com> Date: Sun, 12 Nov 2023 13:43:05 +0100 Subject: [PATCH 02/20] Disable refreshing --- webapp/templates/base.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/templates/base.html.twig b/webapp/templates/base.html.twig index 895750ede8..8ea3c3b5c3 100644 --- a/webapp/templates/base.html.twig +++ b/webapp/templates/base.html.twig @@ -54,7 +54,7 @@ }); {% endif %} /* Enable page refresh if set if wanted by the page, and wanted by the user */ - {% if refresh is defined and refresh and refresh_flag %} + {% if refresh is defined and refresh and refresh_flag and false %} enableRefresh('{{ refresh.url | raw }}', {{ refresh.after }}, {{ refresh.ajax | default(0) }}); {% endif %} From b717f4c37341ae982b63007298468ac6a770eb28 Mon Sep 17 00:00:00 2001 From: Michael Vasseur <14887731+vmcj@users.noreply.github.com> Date: Sun, 12 Nov 2023 18:47:05 +0100 Subject: [PATCH 03/20] Set certain pages to have more width than the horizontal viewport In this case it is needed for a scoreboard with more problems than fit inside the view. --- webapp/src/Controller/Jury/ScoreboardController.php | 1 + webapp/src/Controller/PublicController.php | 1 + webapp/src/Controller/Team/ScoreboardController.php | 1 + webapp/templates/base.html.twig | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/webapp/src/Controller/Jury/ScoreboardController.php b/webapp/src/Controller/Jury/ScoreboardController.php index 7e21ffcc26..c153c4653b 100644 --- a/webapp/src/Controller/Jury/ScoreboardController.php +++ b/webapp/src/Controller/Jury/ScoreboardController.php @@ -28,6 +28,7 @@ public function scoreboardAction(Request $request): Response $data = $this->scoreboardService->getScoreboardTwigData( $request, $response, $refreshUrl, $this->isGranted('ROLE_JURY'), false, false, $contest ); + $data['scroll_width'] = true; if ($request->isXmlHttpRequest()) { $data['current_contest'] = $contest; diff --git a/webapp/src/Controller/PublicController.php b/webapp/src/Controller/PublicController.php index 78649bd1be..a4c7231ce6 100644 --- a/webapp/src/Controller/PublicController.php +++ b/webapp/src/Controller/PublicController.php @@ -72,6 +72,7 @@ public function scoreboardAction( } $data['current_contest'] = $contest; + $data['scroll_width'] = true; if ($request->isXmlHttpRequest()) { return $this->render('partials/scoreboard.html.twig', $data, $response); diff --git a/webapp/src/Controller/Team/ScoreboardController.php b/webapp/src/Controller/Team/ScoreboardController.php index 9573d08691..b1ea82d682 100644 --- a/webapp/src/Controller/Team/ScoreboardController.php +++ b/webapp/src/Controller/Team/ScoreboardController.php @@ -40,6 +40,7 @@ public function scoreboardAction(Request $request): Response $request, $response, $refreshUrl, false, false, false, $contest ); $data['myTeamId'] = $user->getTeam()->getTeamid(); + $data['scroll_width'] = true; if ($request->isXmlHttpRequest()) { $data['current_contest'] = $contest; diff --git a/webapp/templates/base.html.twig b/webapp/templates/base.html.twig index 8ea3c3b5c3..15dfcef9ee 100644 --- a/webapp/templates/base.html.twig +++ b/webapp/templates/base.html.twig @@ -30,7 +30,7 @@ {% block menu %}{% endblock %} {% block body %}
-
+
{% block messages %} {% include 'partials/messages.html.twig' %} From 39a0d78e539f00cc788ad9b91a930015c0fded34 Mon Sep 17 00:00:00 2001 From: Michael Vasseur <14887731+vmcj@users.noreply.github.com> Date: Sun, 12 Nov 2023 18:52:13 +0100 Subject: [PATCH 04/20] Pin warning on scoreboards with many problems This now slides horizontally with the viewer. --- webapp/public/style_domjudge.css | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/webapp/public/style_domjudge.css b/webapp/public/style_domjudge.css index 22e03c303d..86e8b00bf2 100644 --- a/webapp/public/style_domjudge.css +++ b/webapp/public/style_domjudge.css @@ -635,3 +635,13 @@ blockquote { margin-right: 2em; font-weight: normal; } + +.row-scoreboard { + width: fit-content; +} + +.alert-danger { + position: sticky; + width: calc(100vw - var(--bs-gutter-x) * 1.75); + left: calc(var(--bs-gutter-x) * .5); +} From b8f117402ce32b92afc1ee7ba6aea91ca585553b Mon Sep 17 00:00:00 2001 From: Michael Vasseur <14887731+vmcj@users.noreply.github.com> Date: Sun, 12 Nov 2023 16:16:06 +0100 Subject: [PATCH 05/20] Fixate banner on contests with many problems --- webapp/public/style_domjudge.css | 6 ++++++ webapp/templates/public/scoreboard.html.twig | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/webapp/public/style_domjudge.css b/webapp/public/style_domjudge.css index 86e8b00bf2..654ba445a3 100644 --- a/webapp/public/style_domjudge.css +++ b/webapp/public/style_domjudge.css @@ -645,3 +645,9 @@ blockquote { width: calc(100vw - var(--bs-gutter-x) * 1.75); left: calc(var(--bs-gutter-x) * .5); } + +.banner-fixed { + position: sticky; + width: calc(100vw - var(--bs-gutter-x) * 1.75); + left: calc(var(--bs-gutter-x) * .5); +} diff --git a/webapp/templates/public/scoreboard.html.twig b/webapp/templates/public/scoreboard.html.twig index 9b87838085..fb74a64172 100644 --- a/webapp/templates/public/scoreboard.html.twig +++ b/webapp/templates/public/scoreboard.html.twig @@ -15,7 +15,9 @@ {% set bannerImage = globalBannerAssetPath() %} {% endif %} {% if bannerImage %} - + {% endif %}
From 8d962a9e3f53499804d7b79171c4cf9b90ecdc7b Mon Sep 17 00:00:00 2001 From: Michael Vasseur <14887731+vmcj@users.noreply.github.com> Date: Sun, 12 Nov 2023 19:02:21 +0100 Subject: [PATCH 06/20] Fixate the frozen warning + contest info section for scoreboard --- webapp/public/style_domjudge.css | 6 ++++++ webapp/templates/partials/scoreboard.html.twig | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/webapp/public/style_domjudge.css b/webapp/public/style_domjudge.css index 654ba445a3..6d9d91aa25 100644 --- a/webapp/public/style_domjudge.css +++ b/webapp/public/style_domjudge.css @@ -651,3 +651,9 @@ blockquote { width: calc(100vw - var(--bs-gutter-x) * 1.75); left: calc(var(--bs-gutter-x) * .5); } + +.card-contest-frozen-info { + position: sticky; + width: calc(100vw - var(--bs-gutter-x) * 1.75); + left: calc(var(--bs-gutter-x) * .5); +} diff --git a/webapp/templates/partials/scoreboard.html.twig b/webapp/templates/partials/scoreboard.html.twig index 48c211ed4c..596867f592 100644 --- a/webapp/templates/partials/scoreboard.html.twig +++ b/webapp/templates/partials/scoreboard.html.twig @@ -17,7 +17,7 @@
{% endif %} -
+
{{ current_contest.name }} @@ -94,7 +94,7 @@ {% endif %} {% if scoreboard.freezeData.showFrozen(false) %} -