feat: put the placement in one line above the questionnaire
This commit is contained in:
1 parent
a0170f5952
commit
af97468b2d
6 files changed
+96
-93
No files matched your search
@@ -18,7 +18,7 @@
|
||||
|
||||
key: teamer_feedback
|
||||
version: 1
|
||||
title: "Reiseleiter/-in Feedback"
|
||||
title: "Wochenteamer:innen-Feedback"
|
||||
description: |-
|
||||
Nur durch euer Feedback können wir besser werden! 🙂
|
||||
|
||||
|
||||
@@ -3,69 +3,64 @@
|
||||
{% block title %}Fragebogen testen{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1 class="text-2xl font-bold pb-4">
|
||||
Fragebogen testen
|
||||
</h1>
|
||||
{% 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 %}
|
||||
{% 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>
|
||||
{% 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.'
|
||||
} %}
|
||||
<div class="max-w-3xl">
|
||||
<h1 class="text-2xl font-bold pb-2">
|
||||
Fragebogen testen
|
||||
</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.'
|
||||
} %}
|
||||
{% 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 %}
|
||||
</div>
|
||||
<div>
|
||||
<h2 class="text-lg font-bold pb-4">
|
||||
Einsatz
|
||||
</h2>
|
||||
{% include '_partials/_assignment_info.html.twig' %}
|
||||
{% 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>
|
||||
{% 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.'
|
||||
} %}
|
||||
<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="{{ returnUrl }}" class="underline">
|
||||
zurück
|
||||
<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 %}
|
||||
{% include 'questionnaire/_form.html.twig' %}
|
||||
{% endif %}
|
||||
|
||||
<div class="pt-8">
|
||||
<a href="{{ returnUrl }}" class="underline">
|
||||
zurück
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% 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 content %}
|
||||
<h1 class="text-2xl font-bold pb-4">
|
||||
Fragebogen zu deinem Einsatz
|
||||
</h1>
|
||||
<p class="pb-8 text-gray-700">
|
||||
Danke für dein Feedback!
|
||||
</p>
|
||||
<div class="grid lg:grid-cols-3 gap-8 items-start">
|
||||
<div class="lg:col-span-2 flex flex-col gap-y-12">
|
||||
<div class="max-w-3xl">
|
||||
<h1 class="text-2xl font-bold pb-2">
|
||||
Fragebogen zu deinem Einsatz
|
||||
</h1>
|
||||
{% include 'questionnaire/_assignment_summary.html.twig' with { 'assignment': disposition.assignment } %}
|
||||
<p class="pb-8 text-gray-700">
|
||||
Danke für dein Feedback!
|
||||
</p>
|
||||
<div class="flex flex-col gap-y-12">
|
||||
{% for item in submitted %}
|
||||
<section>
|
||||
<h2 class="text-2xl font-bold pb-1">
|
||||
@@ -28,11 +29,5 @@
|
||||
</a>
|
||||
{% endif %}
|
||||
</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>
|
||||
{% endblock %}
|
||||
@@ -3,23 +3,16 @@
|
||||
{% block title %}Fragebogen zu deinem Einsatz{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1 class="text-2xl font-bold pb-8">
|
||||
Fragebogen zu deinem Einsatz
|
||||
</h1>
|
||||
<div class="grid lg:grid-cols-3 gap-8 items-start">
|
||||
<div class="lg:col-span-2">
|
||||
{% include 'questionnaire/_form.html.twig' %}
|
||||
</div>
|
||||
<div>
|
||||
<h2 class="text-lg font-bold pb-4">
|
||||
Dein Einsatz
|
||||
</h2>
|
||||
{% 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 class="max-w-3xl">
|
||||
<h1 class="text-2xl font-bold pb-2">
|
||||
Fragebogen zu deinem Einsatz
|
||||
</h1>
|
||||
{% include 'questionnaire/_assignment_summary.html.twig' with { 'assignment': disposition.assignment } %}
|
||||
{% if lastSaved %}
|
||||
<p class="-mt-6 pb-8 text-sm text-gray-500">
|
||||
Entwurf zuletzt gespeichert am {{ lastSaved|date('d.m.Y, H:i') }} Uhr
|
||||
</p>
|
||||
{% endif %}
|
||||
{% include 'questionnaire/_form.html.twig' %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -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()));
|
||||
|
||||
Reference in new issue
Block a user