feat: put the placement in one line above the questionnaire

This commit is contained in:
fromme committed 2026-10-27 17:27:40 +01:00
1 parent a0170f5952
commit af97468b2d
6 files changed
+96 -93

No files matched your search

+1 -1
View File
@@ -18,7 +18,7 @@
key: teamer_feedback key: teamer_feedback
version: 1 version: 1
title: "Reiseleiter/-in Feedback" title: "Wochenteamer:innen-Feedback"
description: |- description: |-
Nur durch euer Feedback können wir besser werden! 🙂 Nur durch euer Feedback können wir besser werden! 🙂
@@ -3,69 +3,64 @@
{% block title %}Fragebogen testen{% endblock %} {% block title %}Fragebogen testen{% endblock %}
{% block content %} {% block content %}
<h1 class="text-2xl font-bold pb-4"> <div class="max-w-3xl">
Fragebogen testen <h1 class="text-2xl font-bold pb-2">
</h1> Fragebogen testen
{% include '_partials/_alert.html.twig' with { </h1>
'type': 'warning', {% include 'questionnaire/_assignment_summary.html.twig' %}
'message': 'Testmodus: Der Fragebogen verhält sich wie für Teamer:innen, es wird aber nichts gespeichert.' {% include '_partials/_alert.html.twig' with {
} %} 'type': 'warning',
{% set otherVariant = path('app_administrative_questionnaire_test', { 'uuid': assignment.uuid, 'bus_escort': busEscort ? 0 : 1, 'r': app.request.query.get('r') }) %} 'message': 'Testmodus: Der Fragebogen verhält sich wie für Teamer:innen, es wird aber nichts gespeichert.'
{% embed '_partials/_alert.html.twig' with { 'type': 'info' } %} } %}
{% block message %} {% set otherVariant = path('app_administrative_questionnaire_test', { 'uuid': assignment.uuid, 'bus_escort': busEscort ? 0 : 1, 'r': app.request.query.get('r') }) %}
{% if busEscort %} {% embed '_partials/_alert.html.twig' with { 'type': 'info' } %}
Mit dem Bus-Feedback, wie bei einer Busbegleitung. {% block message %}
{% else %} {% if busEscort %}
Ohne das Bus-Feedback, wie bei einem Einsatz ohne Busbegleitung. Mit dem Bus-Feedback, wie bei einer Busbegleitung.
{% endif %} {% else %}
{% if busEscort != assignment.hasBusEscort %} Ohne das Bus-Feedback, wie bei einem Einsatz ohne Busbegleitung.
Dieser Einsatz hat {{ assignment.hasBusEscort ? 'eine' : 'keine' }} Busbegleitung.
{% endif %}
<a href="{{ otherVariant }}" class="underline">{{ busEscort ? 'Ohne' : 'Mit' }} Bus-Feedback testen</a>
{% endblock %}
{% endembed %}
<div class="grid lg:grid-cols-3 gap-8 items-start">
<div class="lg:col-span-2">
{% 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.'
} %}
<div class="flex flex-col gap-y-12">
{% for item in submitted %}
<section>
<h2 class="text-2xl font-bold pb-4">
{{ item.definition.title }}
</h2>
{% include 'questionnaire/_answers.html.twig' with { 'definition': item.definition, 'answers': item.answers } %}
</section>
{% endfor %}
</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
</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.'
} %}
{% endif %} {% endif %}
{% include 'questionnaire/_form.html.twig' %} {% if busEscort != assignment.hasBusEscort %}
{% endif %} Dieser Einsatz hat {{ assignment.hasBusEscort ? 'eine' : 'keine' }} Busbegleitung.
</div> {% endif %}
<div> <a href="{{ otherVariant }}" class="underline">{{ busEscort ? 'Ohne' : 'Mit' }} Bus-Feedback testen</a>
<h2 class="text-lg font-bold pb-4"> {% endblock %}
Einsatz {% endembed %}
</h2>
{% include '_partials/_assignment_info.html.twig' %} {% 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.'
} %}
<div class="flex flex-col gap-y-12">
{% for item in submitted %}
<section>
<h2 class="text-2xl font-bold pb-4">
{{ item.definition.title }}
</h2>
{% include 'questionnaire/_answers.html.twig' with { 'definition': item.definition, 'answers': item.answers } %}
</section>
{% endfor %}
</div>
<div class="pt-8"> <div class="pt-8">
<a href="{{ returnUrl }}" class="underline"> <a href="{{ path('app_administrative_questionnaire_test', { 'uuid': assignment.uuid, 'r': app.request.query.get('r') }) }}" class="btn btn--secondary">
zurück Erneut testen
</a> </a>
</div> </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.'
} %}
{% endif %}
{% include 'questionnaire/_form.html.twig' %}
{% endif %}
<div class="pt-8">
<a href="{{ returnUrl }}" class="underline">
zurück
</a>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}
@@ -0,0 +1,17 @@
{#
# The placement a questionnaire is about, in one line above the form: just enough to know which
# one it is. Expects `assignment`.
#}
{% set destination = assignment.destination %}
{% set pickup = assignment.hasBusEscort ? destination.pickup(assignment.pickup) : null %}
<p class="flex flex-wrap items-center gap-x-2 gap-y-1 pb-8 text-sm text-gray-700">
<span class="font-bold text-gray-900">{{ assignment.jobProfile.name }}</span>
{% include '_partials/_dot.html.twig' %}
<span>{{ destination.product }}</span>
{% include '_partials/_dot.html.twig' %}
<span class="whitespace-nowrap">{{ destination.dateFrom|date('d.m.') }}–{{ destination.dateTo|date('d.m.Y') }}</span>
{% if pickup %}
{% include '_partials/_dot.html.twig' %}
<span class="whitespace-nowrap">Busbegleitung ab {{ pickup.city }}</span>
{% endif %}
</p>
@@ -3,14 +3,15 @@
{% block title %}Fragebogen zu deinem Einsatz{% endblock %} {% block title %}Fragebogen zu deinem Einsatz{% endblock %}
{% block content %} {% block content %}
<h1 class="text-2xl font-bold pb-4"> <div class="max-w-3xl">
Fragebogen zu deinem Einsatz <h1 class="text-2xl font-bold pb-2">
</h1> Fragebogen zu deinem Einsatz
<p class="pb-8 text-gray-700"> </h1>
Danke für dein Feedback! {% include 'questionnaire/_assignment_summary.html.twig' with { 'assignment': disposition.assignment } %}
</p> <p class="pb-8 text-gray-700">
<div class="grid lg:grid-cols-3 gap-8 items-start"> Danke für dein Feedback!
<div class="lg:col-span-2 flex flex-col gap-y-12"> </p>
<div class="flex flex-col gap-y-12">
{% for item in submitted %} {% for item in submitted %}
<section> <section>
<h2 class="text-2xl font-bold pb-1"> <h2 class="text-2xl font-bold pb-1">
@@ -28,11 +29,5 @@
</a> </a>
{% endif %} {% endif %}
</div> </div>
<div>
<h2 class="text-lg font-bold pb-4">
Dein Einsatz
</h2>
{% include '_partials/_assignment_info.html.twig' with { 'assignment': disposition.assignment } %}
</div>
</div> </div>
{% endblock %} {% endblock %}
+11 -18
View File
@@ -3,23 +3,16 @@
{% block title %}Fragebogen zu deinem Einsatz{% endblock %} {% block title %}Fragebogen zu deinem Einsatz{% endblock %}
{% block content %} {% block content %}
<h1 class="text-2xl font-bold pb-8"> <div class="max-w-3xl">
Fragebogen zu deinem Einsatz <h1 class="text-2xl font-bold pb-2">
</h1> Fragebogen zu deinem Einsatz
<div class="grid lg:grid-cols-3 gap-8 items-start"> </h1>
<div class="lg:col-span-2"> {% include 'questionnaire/_assignment_summary.html.twig' with { 'assignment': disposition.assignment } %}
{% include 'questionnaire/_form.html.twig' %} {% if lastSaved %}
</div> <p class="-mt-6 pb-8 text-sm text-gray-500">
<div> Entwurf zuletzt gespeichert am {{ lastSaved|date('d.m.Y, H:i') }} Uhr
<h2 class="text-lg font-bold pb-4"> </p>
Dein Einsatz {% endif %}
</h2> {% include 'questionnaire/_form.html.twig' %}
{% include '_partials/_assignment_info.html.twig' with { 'assignment': disposition.assignment } %}
{% if lastSaved %}
<p class="pt-6 text-sm text-gray-500">
Entwurf zuletzt gespeichert am {{ lastSaved|date('d.m.Y, H:i') }} Uhr
</p>
{% endif %}
</div>
</div> </div>
{% endblock %} {% endblock %}
@@ -75,6 +75,9 @@ class EditControllerTest extends WebTestCase
$crawler = $this->open($this->placement(busEscort: true)); $crawler = $this->open($this->placement(busEscort: true));
$this->assertResponseIsSuccessful(); $this->assertResponseIsSuccessful();
// the placement in one line above the form
$this->assertStringContainsString('Reiseleitung', $crawler->filter('h1 + p')->text());
$this->assertStringContainsString('Busbegleitung ab Stuttgart', $crawler->filter('h1 + p')->text());
$this->assertCount(1, $crawler->filter('[data-question-key="teamer_feedback.office_briefing_rating"]')); $this->assertCount(1, $crawler->filter('[data-question-key="teamer_feedback.office_briefing_rating"]'));
$this->assertCount(1, $crawler->filter('[data-question-key="bus_feedback.bus_company"]')); $this->assertCount(1, $crawler->filter('[data-question-key="bus_feedback.bus_company"]'));
} }
@@ -121,7 +124,7 @@ class EditControllerTest extends WebTestCase
// the read-only view shows both, and the form is closed // the read-only view shows both, and the form is closed
$crawler = $this->client->followRedirect(); $crawler = $this->client->followRedirect();
$this->assertStringContainsString('Reiseleiter/-in Feedback', $crawler->text()); $this->assertStringContainsString('Wochenteamer:innen-Feedback', $crawler->text());
$this->assertStringContainsString('Bus-Feedback', $crawler->text()); $this->assertStringContainsString('Bus-Feedback', $crawler->text());
$this->open($disposition); $this->open($disposition);
$this->assertResponseRedirects(sprintf('/teamer/questionnaire/%s/detail', $disposition->getUuid())); $this->assertResponseRedirects(sprintf('/teamer/questionnaire/%s/detail', $disposition->getUuid()));