feat: add the house manager questionnaire per travel and compact the questionnaire layout

This commit is contained in:
fromme committed 2026-11-11 11:16:37 +01:00
1 parent d760ed3cdf
commit bfef08b519
50 files changed
+2763 -180

No files matched your search

@@ -8,19 +8,25 @@
{{ definition.title }}{% if response.leg %}: {{ response.leg.label }}{% endif %}
</h1>
<p class="pb-8 text-gray-700">
{{ context.teamerName|default('-') }}, abgeschickt am {{ response.submittedAt|date('d.m.Y, H:i') }} Uhr
{{ response.destination ? context.destinationProduct|default('-') : 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' with { 'answers': response.answers } %}
{% include 'questionnaire/_answers.html.twig' with { 'answers': response.answers, 'context': context } %}
</div>
<div>
{# the snapshot taken on submit, so it shows the placement as the teamer answered for it #}
{# the snapshot taken on submit, so it shows the placement or travel as it was answered for #}
<h2 class="text-lg font-bold pb-4">
Einsatz
{{ response.destination ? 'Reise' : 'Einsatz' }}
</h2>
<dl class="divide-y divide-gray-100 text-sm leading-6">
{% for label, value in {
{% for label, value in response.destination ? {
'Destination': context.destinationProduct|default(null),
'Haus': context.hotel|default(null) ? context.hotel ~ ' (' ~ context.hotelCode ~ ')' : null,
'Reisetermin': context.dateFrom|default(null) ? context.dateFrom|date('d.m.Y') ~ ' - ' ~ context.dateTo|date('d.m.Y') : null,
'Wochenteam': context.teamers|default([])|map(teamer => teamer.name ~ ' (' ~ teamer.jobProfileName ~ ')')|join(', ') ?: null,
'Abgeschickt von': response.updatedBy ?? response.createdBy,
} : {
'Teamer:in': context.teamerName|default(null),
'Jobprofil': context.jobProfileName|default(null),
'Destination': context.destinationProduct|default(null),
@@ -43,16 +43,26 @@
<div class="data-table-wrapper__inner">
<table class="data-table">
<thead>
{% set aboutTravel = definition.key == 'house_manager_feedback' %}
<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>
{% 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>
@@ -70,15 +80,21 @@
<tbody>
{% for response in pagination %}
{% set disposition = response.disposition %}
{% set destination = disposition.assignment.destination %}
{% set destination = aboutTravel ? response.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>
{% 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>
@@ -103,7 +119,7 @@
</tr>
{% else %}
<tr>
<td colspan="{{ definition.perBusLeg ? 7 : 6 }}">
<td colspan="{{ definition.perBusLeg ? 7 : (aboutTravel ? 5 : 6) }}">
Keine Daten...
</td>
</tr>
@@ -1,16 +1,16 @@
{% extends 'administrative/layout.html.twig' %}
{% block title %}Fragebogen testen{% endblock %}
{% block title %}Vorschau Reiseleitungsfeedback{% endblock %}
{% block content %}
<div class="max-w-3xl">
<h1 class="text-2xl font-bold pb-2">
Fragebogen testen
Vorschau Reiseleitungsfeedback
</h1>
{% include 'questionnaire/_assignment_summary.html.twig' %}
{% include '_partials/_alert.html.twig' with {
'type': 'warning',
'message': 'Testmodus: Der Fragebogen verhält sich wie für Teamer:innen, es wird aber nichts gespeichert.'
'message': 'Vorschau: Der Fragebogen verhält sich wie für Teamer:innen, es wird aber nichts gespeichert.'
} %}
{% set otherVariant = path('app_administrative_questionnaire_test', { 'uuid': assignment.uuid, 'bus_escort': busEscort ? 0 : 1, 'r': app.request.query.get('r') }) %}
{% embed '_partials/_alert.html.twig' with { 'type': 'info' } %}
@@ -23,7 +23,7 @@
{% if busEscort != assignment.hasBusEscort %}
Dieser Einsatz hat {{ assignment.hasBusEscort ? 'eine' : 'keine' }} Busbegleitung.
{% endif %}
<a href="{{ otherVariant }}" class="underline">{{ busEscort ? 'Ohne' : 'Mit' }} Bus-Feedback testen</a>
<a href="{{ otherVariant }}" class="underline">{{ busEscort ? 'Ohne' : 'Mit' }} Bus-Feedback ansehen</a>
{% endblock %}
{% endembed %}
@@ -44,14 +44,14 @@
</div>
<div class="pt-8">
<a href="{{ path('app_administrative_questionnaire_test', { 'uuid': assignment.uuid, 'r': app.request.query.get('r') }) }}" class="btn btn--secondary">
Erneut testen
Erneut ausprobieren
</a>
</div>
{% else %}
{% if draft %}
{% include '_partials/_alert.html.twig' with {
'type': 'success',
'message': 'Der Entwurf wäre jetzt gespeichert. Im Testmodus bleiben die Angaben nur im Formular.'
'message': 'Der Entwurf wäre jetzt gespeichert. In der Vorschau bleiben die Angaben nur im Formular.'
} %}
{% endif %}
{% include 'questionnaire/_form.html.twig' %}
@@ -0,0 +1,58 @@
{% extends 'administrative/layout.html.twig' %}
{% block title %}Vorschau Hausleitungsfeedback{% endblock %}
{% block content %}
<div class="max-w-3xl">
<h1 class="text-2xl font-bold pb-2">
Vorschau Hausleitungsfeedback
</h1>
{% include 'house_manager/questionnaire/_travel_summary.html.twig' %}
{% include '_partials/_alert.html.twig' with {
'type': 'warning',
'message': 'Vorschau: Der Fragebogen verhält sich wie für die Hausleitung, es wird aber nichts gespeichert.'
} %}
{% if submitted is not null %}
{% include '_partials/_alert.html.twig' with {
'type': 'success',
'message': 'So würde der abgeschickte Fragebogen gespeichert. Ausgeblendete Fragen fallen dabei weg.'
} %}
{% include 'questionnaire/_answers.html.twig' with { 'answers': submitted } %}
<div class="pt-8">
<a href="{{ path('app_administrative_questionnaire_test_house_manager', { 'uuid': assignment.uuid, 'r': app.request.query.get('r') }) }}" class="btn btn--secondary">
Erneut ausprobieren
</a>
</div>
{% else %}
{% if draft %}
{% include '_partials/_alert.html.twig' with {
'type': 'success',
'message': 'Der Entwurf wäre jetzt gespeichert. In der Vorschau bleiben die Angaben nur im Formular.'
} %}
{% endif %}
{% include 'questionnaire/_form.html.twig' %}
<section class="pt-8">
<h2 class="text-xl font-bold pb-2">
Bewerte dein Wochenteam
</h2>
<p class="pb-2 text-sm text-gray-500">
Hier verlinkt die Hausleitung jede:n Teamer:in in die Bewertung:
</p>
<ul class="list-disc pl-5">
{% for disposition in dispositions %}
<li>{{ disposition.teamer.fullName }} <span class="text-gray-500">{{ disposition.assignment.jobProfile.name }}</span></li>
{% else %}
<li>-</li>
{% endfor %}
</ul>
</section>
{% endif %}
<div class="pt-8">
<a href="{{ returnUrl }}" class="underline">
zurück
</a>
</div>
</div>
{% endblock %}