wip 12-03-2025
Some checks failed
CI / Tests (push) Failing after 11s
CI / Docker Lint (push) Successful in 3s

This commit is contained in:
2025-03-12 09:28:36 +01:00
parent f7b4b98da4
commit 448daed6ea
21 changed files with 523 additions and 103 deletions

View File

@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html lang="en" data-bs-theme="dark">
<head>
<meta charset="UTF-8">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH"
crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
crossorigin="anonymous"></script>
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
<link rel="icon"
href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>">
<title>
{% block title %}Tijd voor de test{% endblock title %}
</title>
{% block stylesheets %}
{% endblock %}
{% block javascripts %}
{% endblock %}
</head>
<body>
{% block nav %}
{{ include('backoffice/nav.html.twig') }}
{% endblock nav %}
<main>
<div class="container">
{# {% include "messages.html" %} #}
{% block body %}
{% endblock body %}
</div>
</main>
</body>
</html>

View File

@@ -0,0 +1,48 @@
{% extends 'backoffice/base.html.twig' %}
{% block title %}Hello BackofficeController!{% endblock %}
{% block body %}
<h2>{% trans %}Your Seasons{% endtrans %}</h2>
<table class="table table-hover">
<thead>
<tr>
<th scope="col">{% trans %}Name{% endtrans %}</th>
<th scope="col">{% trans %}Active Quiz{% endtrans %}</th>
<th scope="col">{% trans %}Season Code{% endtrans %}</th>
<th scope="col">{% trans %}Preregister?{% endtrans %}</th>
<th scope="col">{% trans %}Manage{% endtrans %}</th>
</tr>
</thead>
<tbody>
{% for season in seasons %}
<tr class="align-middle">
<td>{{ season.name }}</td>
<td>
{% if season.activeQuiz %}
{{ season.activeQuiz.name }}
{% else %}
{% trans %} No active quiz {% endtrans %}
{% endif %}
</td>
<td>
<a {% if season.activeQuiz %}href="{{ path('enter_name', {seasonCode: season.seasonCode}) }}"
{% else %}class="disabled" {% endif %}>{{ season.seasonCode }}</a>
</td>
<td>
<input class="form-check-input"
type="checkbox"
disabled
{% if season.preregisterCandidates %}checked{% endif %}
aria-label="Preregister Enabled">
</td>
<td>
<a href="{{ path('backoffice_season', {seasonCode: season.seasonCode}) }}">{% trans %}Manage{% endtrans %}</a>
</td>
</tr>
{% else %}
EMPTY
{% endfor %}
</tbody>
</table>
{% endblock %}

View File

@@ -0,0 +1,22 @@
<nav class="navbar navbar-expand-lg bg-body-tertiary">
<div class="container-fluid">
<a class="navbar-brand" href="#">Tijd voor de test</a>
<button class="navbar-toggler"
type="button"
data-bs-toggle="collapse"
data-bs-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent"
aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link{% if 'backoffice_index' == app.current_route() %} active{% endif %}"
href="{{ path('backoffice_index') }}">{{ t('Seasons') }}</a>
</li>
</ul>
</div>
</div>
</nav>

View File

@@ -0,0 +1,95 @@
{% extends 'backoffice/base.html.twig' %}
{% block body %}
<p>
<h2>{{ t('Quiz') }}: {{ quiz.season.name }} - {{ quiz.name }}</h2>
</p>
<div id="questions">
<p>
<h4>{{ t('Questions') }}</h4>
</p>
<div class="accordion">
{% for question in quiz.questions %}
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed"
type="button"
data-bs-toggle="collapse"
data-bs-target="#question-{{ loop.index0 }}"
aria-controls="question-{{ loop.index0 }}">
{# {% with question_error = question.errors %} #}
{# {% if question_error %} #}
{# <span data-bs-toggle="tooltip" #}
{# title="{{ question_error }}" #}
{# class="badge text-bg-danger rounded-pill me-2">!</span> #}
{# {% endif %} #}
{# {% endwith %} #}
{{ loop.index }}. {{ question.question }}
</button>
</h2>
<div id="question-{{ loop.index0 }}"
class="accordion-collapse collapse">
<div class="accordion-body">
{% for answer in question.answers %}
<li {% if answer.isRightAnswer %}class="text-decoration-underline"{% endif %}>{{ answer.text }}</li>
{% else %}
{{ t('There are no answers for this question') }}
{% endfor %}
</div>
</div>
</div>
{% else %}
EMPTY
{% endfor %}
</div>
</div>
<div class="scores">
<p>
<h4>{{ t('Score') }}</h4>
</p>
<div class="btn-toolbar" role="toolbar">
<div class="btn-group btn-group-lg me-2">
<a class="btn btn-primary">{{ t('Start Elimination') }}</a>
</div>
<div class="btn-group btn-group-lg">
<a class="btn btn-secondary">{{ t('Prepare Custom Elimination') }}</a>
<a class="btn btn-secondary">{{ t('Load Prepared Elimination') }}</a>
</div>
</div>
<p>{{ t('Number of dropouts:') }} {{ quiz.dropouts }} </p>
<table class="table table-hover">
<thead>
<tr>
<th scope="col">{{ t('Candidate') }}</th>
<th scope="col">{{ t('Correct Answers') }}</th>
<th scope="col">{{ t('Corrections') }}</th>
<th scope="col">{{ t('Score') }}</th>
<th scope="col">{{ t('Time') }}</th>
</tr>
</thead>
<tbody>
{# {% with result = quiz.get_score %} #}
{# {% for candidate in result %} #}
{# <tr class="table-{% if forloop.revcounter > quiz.dropouts %}success{% else %}danger{% endif %}"> #}
{# <td>{{ candidate.name }}</td> #}
{# <td>{{ candidate.correct }}</td> #}
{# <td>{{ candidate.corrections }}</td> #}
{# <td>{{ candidate.score }}</td> #}
{# <td>{{ candidate.time }}</td> #}
{# </tr> #}
{# {% empty %} #}
{# {% endfor %} #}
</tbody>
</table>
{# {% endwith %} #}
</div>
{% endblock %}
{% block script %}
<script>
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl))
</script>
{% endblock script %}
{% block title %}
{% endblock %}

View File

@@ -0,0 +1,26 @@
{% extends 'backoffice/base.html.twig' %}
{% block body %}
<p>
<h2>{{ t('Season') }}: {{ season.name }}</h2>
</p>
<div class="row">
<div class="col-md-6 col-12">
<h4>{{ t('Quizzes') }}</h4>
<div class="list-group">
{% for quiz in season.quizzes %}
<a class="list-group-item list-group-item-action{% if season.activeQuiz == quiz %} active{% endif %}"
href="{{ path('backoffice_quiz', {seasonCode: season.seasonCode, quiz: quiz.id}) }}">{{ quiz.name }}</a>
{% else %}
No quizzes
{% endfor %}
</div>
</div>
<div class="col-md-6 col-12">
<h4>{{ t('Candidates') }}</h4>
<ul>
{% for candidate in season.candidates %}
<li>{{ candidate.name }}</li>{% endfor %}
</ul>
</div>
</div>
{% endblock body %}

View File

@@ -1,17 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{% block title %}Welcome!{% endblock %}</title>
<link rel="icon"
href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>">
{% block stylesheets %}
{% endblock %}
{% block javascripts %}
{% endblock %}
</head>
<body>
{% block body %}{% endblock %}
</body>
</html>