feat: list and show submitted questionnaires to the office

This commit is contained in:
fromme committed 2026-10-27 17:02:51 +01:00
1 parent 890e04f8a6
commit a35f91ac63
15 files changed
+715 -46

No files matched your search

@@ -0,0 +1,45 @@
{% extends 'administrative/layout.html.twig' %}
{% block title %}{{ definition.title }}{% endblock %}
{% block content %}
{% set context = response.context %}
<h1 class="text-2xl font-bold pb-4">
{{ definition.title }}
</h1>
<p class="pb-8 text-gray-700">
{{ context.teamerName|default('-') }}, abgeschickt am {{ response.submittedAt|date('d.m.Y, H:i') }} Uhr
</p>
<div class="grid lg:grid-cols-3 gap-8 items-start">
<div class="lg:col-span-2">
{% include 'questionnaire/_answers.html.twig' %}
</div>
<div>
{# the snapshot taken on submit, so it shows the placement as the teamer answered for it #}
<h2 class="text-lg font-bold pb-4">
Einsatz
</h2>
<dl class="divide-y divide-gray-100 text-sm leading-6">
{% for label, value in {
'Teamer:in': context.teamerName|default(null),
'Jobprofil': context.jobProfileName|default(null),
'Destination': context.destinationProduct|default(null),
'Haus': context.hotel|default(null) ? context.hotel ~ ' (' ~ context.hotelCode ~ ')' : null,
'Einsatztermin': context.dateFrom|default(null) ? context.dateFrom|date('d.m.Y') ~ ' - ' ~ context.dateTo|date('d.m.Y') : null,
'Busbegleitung ab': context.escortPickup|default(null) ? context.escortPickup.city ~ ', ' ~ context.escortPickup.street ~ (context.escortPickup.time ? ', ' ~ context.escortPickup.time ~ ' Uhr' : '') : null,
'Abfahrt Hinfahrt': context.escortPickupDate|default(null) ? context.escortPickupDate|date('d.m.Y') : null,
} %}
<div class="py-3 first:pt-0 grid grid-cols-3 gap-4">
<dt class="font-bold text-gray-900">{{ label }}</dt>
<dd class="col-span-2 text-gray-700">{{ (value ?? '-') }}</dd>
</div>
{% endfor %}
</dl>
<div class="pt-8">
<a href="{{ returnUrl }}" class="underline">
zurück
</a>
</div>
</div>
</div>
{% endblock %}
@@ -0,0 +1,96 @@
{% extends 'administrative/layout.html.twig' %}
{% block title %}Fragebögen{% endblock %}
{% block content %}
<div class="flex items-start justify-between pb-4">
<h1 class="text-2xl font-bold">
Fragebögen: {{ definition.title }}
</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>
<div class="data-table-wrapper">
<div class="data-table-wrapper__inner">
<table class="data-table">
<thead>
<tr>
<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>
<th>
{{ knp_pagination_sortable(pagination, 'Haus', 'destination.hotel') }}
</th>
<th>
{{ knp_pagination_sortable(pagination, 'Abgeschickt', 'response.submittedAt') }}
</th>
<th></th>
</tr>
</thead>
<tbody>
{% for response in pagination %}
{% set disposition = response.disposition %}
{% set destination = disposition.assignment.destination %}
<tr>
<td>
{{ disposition.teamer.lastName }}
</td>
<td>
{{ disposition.teamer.firstName }}
{% include '_partials/_teamer_deleted_badge.html.twig' with { 'teamer': disposition.teamer } %}
</td>
<td>
{{ destination.dateFrom|date('d.m.Y') }}-
<br>
{{ destination.dateTo|date('d.m.Y') }}
</td>
<td>
{{ destination.hotel }}
</td>
<td>
{{ response.submittedAt|date('d.m.Y') }}
</td>
<td>
<a href="{{ path('app_administrative_questionnaire_detail', { 'uuid': response.uuid, 'r': return_url() }) }}" title="Fragebogen anzeigen">
{{ icon('info', 'w-4 h-4') }}
</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="6">
Keine Daten...
</td>
</tr>
{% endfor %}
</tbody>
</table>
{{ knp_pagination_render(pagination) }}
</div>
</div>
{% endblock %}
@@ -0,0 +1,19 @@
{% extends 'htmx_modal.html.twig' %}
{% block title %}Fragebögen filtern{% endblock %}
{% block content %}
{{ form_start(filterForm, { 'attr': { 'hx-post': app.request.uri, 'hx-target': '#htmx-modal', 'hx-swap': 'outerHTML' } }) }}
<div class="flex flex-col space-y-2 pb-4">
{{ form_row(filterForm.teamer) }}
{{ form_row(filterForm.hotel) }}
{{ form_row(filterForm.dateFrom) }}
{{ form_row(filterForm.dateTo) }}
</div>
<div class="flex items-center space-x-2">
{{ form_widget(filterForm.apply, { 'attr': { 'class': 'btn' } }) }}
{{ form_widget(filterForm.reset, { 'attr': { 'class': 'btn btn--secondary' } }) }}
</div>
{{ form_rest(filterForm) }}
{{ form_end(filterForm) }}
{% endblock %}