Files
myep-team/templates/administrative/season_assignment/_task_row.html.twig
T

64 lines
3.2 KiB
Twig

{# 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">
<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') %}
{% if row.document is not null %}
<a href="{{ path('app_common_download', { 'uuid': row.document.uuid }) }}"
class="text-sm underline">
{{ row.document.displayName ?? row.document.originalFilename }}
</a>
{% else %}
<div class="text-sm text-gray-500">kein Dokument hinterlegt</div>
{% endif %}
{% elseif row.definition.provides == constant('App\\Config\\SeasonTaskProvision::INDIVIDUAL') %}
<div class="text-sm text-gray-500">individuelles Dokument</div>
{% endif %}
</td>
<td class="py-2 pr-4 align-top whitespace-nowrap">
{{ row.deadline1 is not null ? row.deadline1 | date('d.m.Y') : '-' }}
{% if row.task.deadlineOverride1 is not null %}
<span class="text-xs text-gray-500">(angepasst)</span>
{% endif %}
</td>
<td class="py-2 pr-4 align-top whitespace-nowrap">
{{ row.deadline2 is not null ? row.deadline2 | date('d.m.Y') : '-' }}
{% if row.task.deadlineOverride2 is not null %}
<span class="text-xs text-gray-500">(angepasst)</span>
{% endif %}
</td>
<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 }}"
hx-swap="outerHTML">
</td>
<td class="py-2 pr-4 align-top text-center">
<input type="checkbox"
class="text-primary"
{{ 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-swap="outerHTML">
{% if row.task.done and row.task.doneAt is not null %}
<div class="text-xs text-gray-500 whitespace-nowrap">
{{ row.task.doneAt | date('d.m.Y') }}{% if row.task.doneBy is not null %}, {{ row.task.doneBy }}{% endif %}
</div>
{% endif %}
</td>
<td class="py-2 align-top text-right">
<button type="button"
class="text-sm underline"
hx-get="{{ path('app_administrative_season_assignment_task_deadline', { 'uuid': row.task.uuid, 'r': return_url() }) }}"
hx-target="body"
hx-swap="beforeend">
Fristen
</button>
</td>
</tr>