From d8b671046b0e6ea1ca4ec00f20e06c831ca36f10 Mon Sep 17 00:00:00 2001 From: Marijn Doeve Date: Wed, 1 Jul 2026 18:32:57 +0200 Subject: [PATCH] Clean up templates and CSS - season.html.twig: remove dead empty column, drop redundant flex-row - tab_overview.html.twig: extract Twig macro for confirm modals, fix duplicate aria-labelledby IDs - tab_result.html.twig: remove dead comment, replace inline widths with CSS classes, simplify nested row/col forms to d-flex gap-1 - backoffice.scss: add col-result-xs/sm/md column width classes - quiz.scss: replace broken display:grid + justify-self:center with flexbox centering --- assets/styles/backoffice.scss | 3 + assets/styles/quiz.scss | 15 ++-- .../backoffice/quiz/tab_overview.html.twig | 86 ++++++++----------- .../backoffice/quiz/tab_result.html.twig | 41 ++++----- templates/backoffice/season.html.twig | 7 +- 5 files changed, 69 insertions(+), 83 deletions(-) diff --git a/assets/styles/backoffice.scss b/assets/styles/backoffice.scss index e69de29..4ab8c9f 100644 --- a/assets/styles/backoffice.scss +++ b/assets/styles/backoffice.scss @@ -0,0 +1,3 @@ +.col-result-xs { width: 10%; } +.col-result-sm { width: 15%; } +.col-result-md { width: 20%; } diff --git a/assets/styles/quiz.scss b/assets/styles/quiz.scss index 4fb76ee..14a112f 100644 --- a/assets/styles/quiz.scss +++ b/assets/styles/quiz.scss @@ -1,14 +1,17 @@ -html, body { +html { height: 100%; +} + +body { + min-height: 100%; background-image: url("../img/background.png"); - background-position: center center; + background-position: center; background-repeat: no-repeat; background-color: black; color: white; - - display: grid; - align-items: center; - justify-self: center; + display: flex; + flex-direction: column; + justify-content: center; } .elimination-screen { diff --git a/templates/backoffice/quiz/tab_overview.html.twig b/templates/backoffice/quiz/tab_overview.html.twig index 3ab04c2..6db7316 100644 --- a/templates/backoffice/quiz/tab_overview.html.twig +++ b/templates/backoffice/quiz/tab_overview.html.twig @@ -1,3 +1,27 @@ +{% macro confirm_modal(id, target, body, formAction, csrfToken) %} + +{% endmacro %} +

{{ 'Quick actions'|trans }}

@@ -66,53 +90,19 @@ {% endfor %}
- {# Modal Clear #} - + {{ _self.confirm_modal( + 'clearQuizModal', + 'clearModal', + 'Are you sure you want to clear all the results? This will also delete all the eliminations.'|trans, + path('tvdt_backoffice_quiz_clear', {quiz: quiz.id}), + csrf_token('clear_quiz'), + ) }} - {# Modal Delete #} - + {{ _self.confirm_modal( + 'deleteQuizModal', + 'deleteModal', + 'Are you sure you want to delete this quiz?'|trans, + path('tvdt_backoffice_quiz_delete', {quiz: quiz.id}), + csrf_token('delete_quiz'), + ) }}
diff --git a/templates/backoffice/quiz/tab_result.html.twig b/templates/backoffice/quiz/tab_result.html.twig index d1c9101..cef5e6e 100644 --- a/templates/backoffice/quiz/tab_result.html.twig +++ b/templates/backoffice/quiz/tab_result.html.twig @@ -1,7 +1,6 @@

{{ 'Score'|trans }}

{{ 'Number of dropouts:'|trans }} {{ quiz.dropouts }}

- +
- - - - - + + + + + @@ -40,15 +39,11 @@ -
-
- -
-
- -
+
+ +
@@ -56,15 +51,11 @@
-
-
- -
-
- -
+
+ +
diff --git a/templates/backoffice/season.html.twig b/templates/backoffice/season.html.twig index 9b5d88f..166931d 100644 --- a/templates/backoffice/season.html.twig +++ b/templates/backoffice/season.html.twig @@ -14,7 +14,7 @@

{{ 'Season'|trans }}: {{ season.name }}

{{ 'Candidate'|trans }}{{ 'Correct Answers'|trans }}{{ 'Corrections'|trans }}{{ 'Penalty'|trans }}{{ 'Score'|trans }}{{ 'Time'|trans }}{{ 'Correct Answers'|trans }}{{ 'Corrections'|trans }}{{ 'Penalty'|trans }}{{ 'Score'|trans }}{{ 'Time'|trans }}