feat: additional functionality and layout adjustments for season teamers

This commit is contained in:
fromme committed 2026-09-26 12:13:16 +02:00
1 parent 80c6016da3
commit 4cab57d136
30 files changed
+916 -192

No files matched your search

+2 -2
View File
@@ -1,7 +1,7 @@
{% set type = type|default('info') %}
<div class="{{ html_classes('p-4 mb-4 flex items-start space-x-2 text-gray-100 rounded-md', { 'bg-blue-600': type == 'info', 'bg-red-600': type == 'warning' }) }}">
{{ icon('alert', 'w-5 h-5 flex-shrink-0') }}
<div class="{{ html_classes('p-4 mb-4 flex items-start space-x-2 text-gray-100 rounded-md', { 'bg-blue-600': type == 'info', 'bg-red-600': type == 'warning', 'bg-green-600': type == 'success' }) }}">
{{ icon(type == 'success' ? 'check' : 'alert', 'w-5 h-5 flex-shrink-0') }}
<div class="leading-relaxed text-base">
{% block message %}
{{ message | nl2br }}
@@ -0,0 +1,28 @@
{# Table and status box together, swapped as one by the row toggles - hence the id and the
outerHTML swap on the checkboxes inside _task_row.html.twig.
The box cannot be swapped out of band alongside a single <tr>: htmx re-parses a response that
starts with a row as "<table><tbody>" + response, and the HTML parser foster-parents any
non-table element out of that tbody again, so the box would be dropped without an error. #}
<div id="season-checklist">
<div class="data-table-wrapper overflow-x-auto">
<table class="w-full text-left">
<thead>
<tr class="border-b-2 border-gray-300">
<th class="py-2 pr-4">Dokument/ToDo</th>
<th class="py-2 pr-4">Frist 1</th>
<th class="py-2 pr-4">Frist 2</th>
<th class="py-2 pr-4 text-center">ToDo</th>
<th class="py-2 pr-4 text-center">erledigt</th>
<th class="py-2"></th>
</tr>
</thead>
<tbody>
{% for row in checklist %}
{% include 'administrative/season_assignment/_task_row.html.twig' with { 'row': row } only %}
{% endfor %}
</tbody>
</table>
</div>
{% include 'administrative/season_assignment/_checklist_status.html.twig' with { 'checklistStatus': checklistStatus } only %}
</div>
@@ -0,0 +1,21 @@
{# Derived from every row at once, so it is re-rendered with the whole checklist rather than on
its own. Nothing is shown while entries are open: the table sits right above. #}
{% if checklistStatus == constant('App\\Config\\SeasonChecklistStatus::COMPLETE') %}
<div class="pt-4">
{% embed '_partials/_alert.html.twig' with { 'type': 'success' } only %}
{% block message %}
<span class="font-bold">Alle ToDos erledigt.</span>
Teamer:in ist vollständig erfasst.
{% endblock %}
{% endembed %}
</div>
{% elseif checklistStatus == constant('App\\Config\\SeasonChecklistStatus::RETURNS_COMPLETE') %}
<div class="pt-4">
{% embed '_partials/_alert.html.twig' with { 'type': 'info' } only %}
{% block message %}
<span class="font-bold">Teamerdokumente vollständig.</span>
Der wöchentliche Reminder ist deaktiviert.
{% endblock %}
{% endembed %}
</div>
{% endif %}
@@ -1,17 +0,0 @@
{# Swapped in place by its own route, so the id and the outerHTML swap have to stay. #}
<div id="season-done-teamer" class="flex items-start space-x-2">
<input type="checkbox"
id="season-done-teamer-input"
class="mt-1 text-primary"
{{ seasonAssignment.doneTeamer ? 'checked' : '' }}
hx-post="{{ path('app_administrative_season_assignment_done_teamer', { 'uuid': seasonAssignment.uuid }) }}"
hx-target="#season-done-teamer"
hx-swap="outerHTML">
<label for="season-done-teamer-input">
<span class="font-bold">Teamer:in erledigt</span>
<span class="block text-sm text-gray-500">
Reiner Vermerk, die wöchentliche Erinnerung läuft weiter,
solange ein Punkt der Checkliste mit Rückgabe offen ist.
</span>
</label>
</div>
@@ -1,6 +1,7 @@
{# One checklist row. Rendered inside the table on the detail page and again on its own by the
toggle route, which swaps exactly this element - hence the id and the outerHTML swap. #}
<tr id="season-task-{{ row.task.uuid }}" class="border-b border-gray-200">
{# One checklist row. The toggles swap the whole checklist rather than this row: the status box
below the table is derived from every row at once, so a row-only swap would leave it a stage
behind. #}
<tr class="border-b border-gray-200">
<td class="py-2 pr-4 align-top">
<div class="font-bold">{{ row.definition.label }}</div>
{% if row.definition.provides == constant('App\\Config\\SeasonTaskProvision::STANDARD') %}
@@ -31,10 +32,10 @@
<td class="py-2 pr-4 align-top text-center">
<input type="checkbox"
class="text-primary"
{{ row.task.uploaded ? 'checked' : '' }}
aria-label="Dokument erhalten"
hx-post="{{ path('app_administrative_season_assignment_task_toggle', { 'uuid': row.task.uuid, 'field': 'uploaded' }) }}"
hx-target="#season-task-{{ row.task.uuid }}"
{{ row.task.officeDone ? 'checked' : '' }}
aria-label="Büro erledigt"
hx-post="{{ path('app_administrative_season_assignment_task_toggle', { 'uuid': row.task.uuid, 'field': 'office_done' }) }}"
hx-target="#season-checklist"
hx-swap="outerHTML">
</td>
<td class="py-2 pr-4 align-top text-center">
@@ -43,7 +44,7 @@
{{ row.task.done ? 'checked' : '' }}
aria-label="Erledigt"
hx-post="{{ path('app_administrative_season_assignment_task_toggle', { 'uuid': row.task.uuid, 'field': 'done' }) }}"
hx-target="#season-task-{{ row.task.uuid }}"
hx-target="#season-checklist"
hx-swap="outerHTML">
{% if row.task.done and row.task.doneAt is not null %}
<div class="text-xs text-gray-500 whitespace-nowrap">
@@ -82,32 +82,7 @@
<h2 class="text-xl font-bold pb-2">
Checkliste
</h2>
<div class="data-table-wrapper overflow-x-auto">
<table class="w-full text-left">
<thead>
<tr class="border-b-2 border-gray-300">
<th class="py-2 pr-4">Dokument/ToDo</th>
<th class="py-2 pr-4">Frist 1</th>
<th class="py-2 pr-4">Frist 2</th>
<th class="py-2 pr-4 text-center">erhalten</th>
<th class="py-2 pr-4 text-center">erledigt</th>
<th class="py-2"></th>
</tr>
</thead>
<tbody>
{% for row in checklist %}
{% include 'administrative/season_assignment/_task_row.html.twig' with { 'row': row } only %}
{% endfor %}
</tbody>
</table>
</div>
<p class="pt-2 text-sm text-gray-500">
Nur <em>erledigt</em> schließt einen Punkt ab und beendet die Erinnerungen.
<em>erhalten</em> ist ein reiner Vermerk.
</p>
<div class="pt-4">
{% include 'administrative/season_assignment/_done_teamer.html.twig' %}
</div>
{% include 'administrative/season_assignment/_checklist.html.twig' %}
</div>
<div class="pb-8">
@@ -7,7 +7,9 @@
Saisonteam-Dokumente
</h1>
<p class="pb-8 text-gray-500">
Auswahl der Standarddokumente für das Saisonteam.
Auswahl der Standarddokumente für das Saisonteam. Ein hier hinterlegtes Dokument gilt für
Saisoneinsätze, die ab dann angelegt werden; bestehende Einsätze behalten ihre Datei und
können es über {{ icon('refresh', 'w-4 h-4 inline-block') }} nachträglich erhalten.
</p>
<div class="data-table-wrapper">
<div class="data-table-wrapper__inner">
@@ -35,6 +37,13 @@
<td>
<div class="flex items-center space-x-2 justify-end">
{% if row.document is not null %}
<button type="button"
title="auf offene Einsätze übertragen"
hx-get="{{ path('app_administrative_system_season_task_document_propagate', { 'uuid': row.document.uuid }) }}"
hx-target="body"
hx-swap="beforeend">
{{ icon('refresh') }}
</button>
<button type="button"
class="text-red-500"
hx-get="{{ path('app_administrative_system_season_task_document_delete', { 'uuid': row.document.uuid }) }}"
@@ -3,11 +3,32 @@
{% block title %}Dokument für {{ task.label }}{% endblock %}
{% block content %}
{{ form_start(form, { 'attr': { 'hx-post': app.request.uri, 'hx-target': '#htmx-modal', 'hx-swap': 'outerHTML' } }) }}
<div class="flex flex-col space-y-4 pb-8">
{% set formAttr = stimulus_controller('form-upload-guard')|stimulus_action('form-upload-guard', 'guard', 'submit') %}
{{ form_start(form, { 'attr': { 'hx-post': app.request.uri, 'hx-target': '#htmx-modal', 'hx-swap': 'outerHTML' }|merge(formAttr.toArray()) }) }}
{{ form_errors(form) }}
<div class="pb-4 text-gray-500">
Das Dokument gilt für Saisoneinsätze, die ab jetzt angelegt werden. Bestehende Einsätze
behalten ihre Datei - sie lässt sich von der Übersicht aus auf offene Einsätze übertragen.
</div>
<div class="flex flex-col space-y-4 pb-4">
{{ form_row(form.document) }}
</div>
<button type="submit" class="btn">
<div class="pb-4">
<div class="font-bold">oder neue Datei hochladen</div>
<div class="pb-2 text-sm text-gray-500">
Eine hochgeladene Datei ersetzt die Auswahl oben.
</div>
{% include '_partials/_upload_collection_form.html.twig' with {
'endpoint_upload': path('_uploader_upload_document'),
'max_filesize': 5,
'max_files': 1,
'accepted_files': 'application/pdf',
} %}
</div>
<div class="flex flex-col space-y-4 pb-8">
{{ form_row(form.displayName) }}
</div>
<button type="submit" class="btn" {{ stimulus_target('form-upload-guard', 'submit') }}>
Speichern
</button>
{{ form_rest(form) }}
@@ -0,0 +1,35 @@
{% extends 'htmx_modal.html.twig' %}
{% block title %}Dokument übertragen{% endblock %}
{% block content %}
<div class="pb-4">
Soll <em>{{ seasonTaskDocument.document.displayName ?? seasonTaskDocument.document.originalFilename }}</em>
auf bestehende Saisoneinsätze übertragen werden?
</div>
{% if tasks | length > 0 %}
<div class="pb-4">
Betroffen sind <strong>{{ tasks | length }}</strong> offene Einsätze bei
<em>{{ seasonTaskDocument.task.label }}</em>. Bereits erledigte Punkte und beendete
Einsätze behalten ihr bisheriges Dokument.
</div>
<ul class="pb-8 divide-y divide-gray-200">
{% for task in tasks %}
<li class="py-2">
{{ task.seasonAssignment | season_assignment_label }}
</li>
{% endfor %}
</ul>
<form hx-post="{{ path('app_administrative_system_season_task_document_propagate', { 'uuid': seasonTaskDocument.uuid }) }}"
hx-target="#htmx-modal"
hx-swap="outerHTML">
<button type="submit" class="btn">
übertragen
</button>
</form>
{% else %}
<div class="pb-4 text-gray-500">
Es gibt keinen offenen Einsatz, auf den das Dokument übertragen werden könnte.
</div>
{% endif %}
{% endblock %}