feat: additional functionality and layout adjustments for season teamers
This commit is contained in:
1 parent
80c6016da3
commit
4cab57d136
30 files changed
+916
-192
No files matched your search
@@ -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">
|
||||
|
||||
Reference in new issue
Block a user