132 lines
6.0 KiB
Twig
132 lines
6.0 KiB
Twig
{% extends 'administrative/layout.html.twig' %}
|
|
|
|
{% block title %}Fragebögen: {{ definition.title }}{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="flex items-start justify-between pb-4">
|
|
<h1 class="text-2xl font-bold">
|
|
Fragebögen
|
|
</h1>
|
|
<div class="flex flex-col items-end space-y-2 md:flex-row md:items-center md:space-x-2 md:space-y-0">
|
|
<button type="button"
|
|
class="{{ html_classes('btn btn--small', { 'btn--secondary': filterDto.active }) }}"
|
|
title="Filter"
|
|
hx-get="{{ path('app_common_questionnaire_response_filter', { 'r': return_url() }) }}"
|
|
hx-target="body"
|
|
hx-swap="beforeend">
|
|
{{ icon('filter', 'w-4 h-4 shrink-0') }}
|
|
{% if filterDto.active %}
|
|
<span class="whitespace-nowrap">{{ filterDto.activeFiltersCount }} Filter aktiv</span>
|
|
{% else %}
|
|
<span>Filter</span>
|
|
{% endif %}
|
|
</button>
|
|
{% if filterDto.active %}
|
|
<a href="{{ path('app_common_questionnaire_response_filter_reset', { 'r': return_url() }) }}" class="btn btn--small btn--secondary">
|
|
Reset
|
|
</a>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{# one tab per questionnaire, as the record tabs (_partials/_tabs.html.twig) #}
|
|
<nav aria-label="Fragebögen" class="tabs mb-6">
|
|
{% for other in definitions %}
|
|
{% set current = other.key == definition.key %}
|
|
<a href="{{ path('app_administrative_questionnaire_index', { 'questionnaire': other.key }) }}"
|
|
class="{{ html_classes('tab', { 'tab--current': current }) }}"
|
|
{% if current %}aria-current="page"{% endif %}>{{ other.title }}</a>
|
|
{% endfor %}
|
|
</nav>
|
|
|
|
<div class="data-table-wrapper">
|
|
<div class="data-table-wrapper__inner">
|
|
<table class="data-table">
|
|
<thead>
|
|
{% set aboutTravel = definition.key == 'house_manager_feedback' %}
|
|
<tr>
|
|
{% if aboutTravel %}
|
|
<th>
|
|
{{ knp_pagination_sortable(pagination, 'Destination', 'destination.product') }}
|
|
</th>
|
|
<th>
|
|
{{ knp_pagination_sortable(pagination, 'Reisezeitraum', 'destination.dateFrom') }}
|
|
</th>
|
|
{% else %}
|
|
<th>
|
|
{{ knp_pagination_sortable(pagination, 'Name', 'teamer.lastName') }}
|
|
</th>
|
|
<th>
|
|
{{ knp_pagination_sortable(pagination, 'Vorname', 'teamer.firstName') }}
|
|
</th>
|
|
<th>
|
|
{{ knp_pagination_sortable(pagination, 'Einsatzzeitraum', 'destination.dateFrom') }}
|
|
</th>
|
|
{% endif %}
|
|
<th>
|
|
{{ knp_pagination_sortable(pagination, 'Haus', 'destination.hotel') }}
|
|
</th>
|
|
{% if definition.perBusLeg %}
|
|
<th>
|
|
{{ knp_pagination_sortable(pagination, 'Fahrt', 'response.leg') }}
|
|
</th>
|
|
{% endif %}
|
|
<th>
|
|
{{ knp_pagination_sortable(pagination, 'Abgeschickt', 'response.submittedAt') }}
|
|
</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for response in pagination %}
|
|
{% set disposition = response.disposition %}
|
|
{% set destination = aboutTravel ? response.destination : disposition.assignment.destination %}
|
|
<tr>
|
|
{% if aboutTravel %}
|
|
<td>
|
|
{{ destination.product }}
|
|
</td>
|
|
{% else %}
|
|
<td>
|
|
{{ disposition.teamer.lastName }}
|
|
</td>
|
|
<td>
|
|
{{ disposition.teamer.firstName }}
|
|
{% include '_partials/_teamer_deleted_badge.html.twig' with { 'teamer': disposition.teamer } %}
|
|
</td>
|
|
{% endif %}
|
|
<td>
|
|
{{ destination.dateFrom|date('d.m.Y') }}-
|
|
<br>
|
|
{{ destination.dateTo|date('d.m.Y') }}
|
|
</td>
|
|
<td>
|
|
{{ destination.hotel }}
|
|
</td>
|
|
{% if definition.perBusLeg %}
|
|
<td>
|
|
{{ response.leg.label|default('-') }}
|
|
</td>
|
|
{% endif %}
|
|
<td>
|
|
{{ response.submittedAt|date('d.m.Y') }}
|
|
</td>
|
|
<td>
|
|
<a href="{{ path('app_administrative_questionnaire_detail', { 'uuid': response.uuid, 'r': return_url() }) }}" class="text-brand hover:text-brand-dark" title="Fragebogen anzeigen">
|
|
{{ icon('info', 'w-4 h-4') }}
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
{% else %}
|
|
<tr>
|
|
<td colspan="{{ definition.perBusLeg ? 7 : (aboutTravel ? 5 : 6) }}">
|
|
<span class="text-muted">Keine Fragebögen gefunden.</span>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{{ knp_pagination_render(pagination) }}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|