- {% 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.'
- } %}
-
- {% for item in submitted %}
-
-
- {{ item.definition.title }}
-
- {% include 'questionnaire/_answers.html.twig' with { 'definition': item.definition, 'answers': item.answers } %}
-
- {% endfor %}
-
-
- {% 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.'
- } %}
+
+
+ Fragebogen testen
+
+ {% 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.'
+ } %}
+ {% 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' } %}
+ {% block message %}
+ {% if busEscort %}
+ Mit dem Bus-Feedback, wie bei einer Busbegleitung.
+ {% else %}
+ Ohne das Bus-Feedback, wie bei einem Einsatz ohne Busbegleitung.
{% endif %}
- {% include 'questionnaire/_form.html.twig' %}
- {% endif %}
-
-
-
- Einsatz
-
- {% include '_partials/_assignment_info.html.twig' %}
+ {% if busEscort != assignment.hasBusEscort %}
+ Dieser Einsatz hat {{ assignment.hasBusEscort ? 'eine' : 'keine' }} Busbegleitung.
+ {% endif %}
+
{{ busEscort ? 'Ohne' : 'Mit' }} Bus-Feedback testen
+ {% endblock %}
+ {% endembed %}
+
+ {% 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.'
+ } %}
+
+ {% for item in submitted %}
+
+
+ {{ item.definition.title }}
+
+ {% include 'questionnaire/_answers.html.twig' with { 'definition': item.definition, 'answers': item.answers } %}
+
+ {% endfor %}
+
+ {% 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 %}
+
+
{% endblock %}
diff --git a/templates/questionnaire/_assignment_summary.html.twig b/templates/questionnaire/_assignment_summary.html.twig
new file mode 100644
index 0000000..b8abb38
--- /dev/null
+++ b/templates/questionnaire/_assignment_summary.html.twig
@@ -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 %}
+
+ {{ assignment.jobProfile.name }}
+ {% include '_partials/_dot.html.twig' %}
+ {{ destination.product }}
+ {% include '_partials/_dot.html.twig' %}
+ {{ destination.dateFrom|date('d.m.') }}–{{ destination.dateTo|date('d.m.Y') }}
+ {% if pickup %}
+ {% include '_partials/_dot.html.twig' %}
+ Busbegleitung ab {{ pickup.city }}
+ {% endif %}
+
diff --git a/templates/teamer/questionnaire/detail.html.twig b/templates/teamer/questionnaire/detail.html.twig
index 6efe7ff..de0693e 100644
--- a/templates/teamer/questionnaire/detail.html.twig
+++ b/templates/teamer/questionnaire/detail.html.twig
@@ -3,14 +3,15 @@
{% block title %}Fragebogen zu deinem Einsatz{% endblock %}
{% block content %}
-
- Fragebogen zu deinem Einsatz
-
-
- Danke für dein Feedback!
-
-
-
+
+
+ Fragebogen zu deinem Einsatz
+
+ {% include 'questionnaire/_assignment_summary.html.twig' with { 'assignment': disposition.assignment } %}
+
+ Danke für dein Feedback!
+
+
{% for item in submitted %}
@@ -28,11 +29,5 @@
{% endif %}
-
-
- Dein Einsatz
-
- {% include '_partials/_assignment_info.html.twig' with { 'assignment': disposition.assignment } %}
-
{% endblock %}
diff --git a/templates/teamer/questionnaire/edit.html.twig b/templates/teamer/questionnaire/edit.html.twig
index fb7b8d7..74ee8fa 100644
--- a/templates/teamer/questionnaire/edit.html.twig
+++ b/templates/teamer/questionnaire/edit.html.twig
@@ -3,23 +3,16 @@
{% block title %}Fragebogen zu deinem Einsatz{% endblock %}
{% block content %}
-
- Fragebogen zu deinem Einsatz
-
-
-
- {% include 'questionnaire/_form.html.twig' %}
-
-
-
- Dein Einsatz
-
- {% include '_partials/_assignment_info.html.twig' with { 'assignment': disposition.assignment } %}
- {% if lastSaved %}
-
- Entwurf zuletzt gespeichert am {{ lastSaved|date('d.m.Y, H:i') }} Uhr
-
- {% endif %}
-
+
+
+ Fragebogen zu deinem Einsatz
+
+ {% include 'questionnaire/_assignment_summary.html.twig' with { 'assignment': disposition.assignment } %}
+ {% if lastSaved %}
+
+ Entwurf zuletzt gespeichert am {{ lastSaved|date('d.m.Y, H:i') }} Uhr
+
+ {% endif %}
+ {% include 'questionnaire/_form.html.twig' %}
{% endblock %}
diff --git a/tests/Controller/Teamer/Questionnaire/EditControllerTest.php b/tests/Controller/Teamer/Questionnaire/EditControllerTest.php
index 3d6a130..d467626 100644
--- a/tests/Controller/Teamer/Questionnaire/EditControllerTest.php
+++ b/tests/Controller/Teamer/Questionnaire/EditControllerTest.php
@@ -75,6 +75,9 @@ class EditControllerTest extends WebTestCase
$crawler = $this->open($this->placement(busEscort: true));
$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="bus_feedback.bus_company"]'));
}
@@ -121,7 +124,7 @@ class EditControllerTest extends WebTestCase
// the read-only view shows both, and the form is closed
$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->open($disposition);
$this->assertResponseRedirects(sprintf('/teamer/questionnaire/%s/detail', $disposition->getUuid()));