refactor: split the questionnaire into teamer and bus feedback
This commit is contained in:
1 parent
2f4f9800dd
commit
a0170f5952
35 files changed
+1114
-554
No files matched your search
@@ -35,6 +35,20 @@
|
||||
</div>
|
||||
{% endfor %}
|
||||
</dl>
|
||||
{% if siblings is not empty %}
|
||||
<h2 class="text-lg font-bold pt-8 pb-2">
|
||||
Zum selben Einsatz
|
||||
</h2>
|
||||
<ul>
|
||||
{% for sibling in siblings %}
|
||||
<li>
|
||||
<a href="{{ path('app_administrative_questionnaire_detail', { 'uuid': sibling.response.uuid, 'r': app.request.query.get('r') }) }}" class="underline">
|
||||
{{ sibling.title }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
<div class="pt-8">
|
||||
<a href="{{ returnUrl }}" class="underline">
|
||||
zurück
|
||||
|
||||
@@ -1,12 +1,22 @@
|
||||
{% extends 'administrative/layout.html.twig' %}
|
||||
|
||||
{% block title %}Fragebögen{% endblock %}
|
||||
{% block title %}Fragebögen: {{ definition.title }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="flex items-start justify-between pb-4">
|
||||
<h1 class="text-2xl font-bold">
|
||||
Fragebögen: {{ definition.title }}
|
||||
</h1>
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold pb-2">
|
||||
Fragebögen: {{ definition.title }}
|
||||
</h1>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
{% for other in definitions %}
|
||||
<a href="{{ path('app_administrative_questionnaire_index', { 'questionnaire': other.key }) }}"
|
||||
class="{{ html_classes('btn btn--small', { 'btn--secondary': other.key != definition.key }) }}">
|
||||
{{ other.title }}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<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 }) }}"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{% extends 'administrative/layout.html.twig' %}
|
||||
|
||||
{% block title %}{{ definition.title }} (Testmodus){% endblock %}
|
||||
{% block title %}Fragebogen testen{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1 class="text-2xl font-bold pb-4">
|
||||
{{ definition.title }}
|
||||
Fragebogen testen
|
||||
</h1>
|
||||
{% include '_partials/_alert.html.twig' with {
|
||||
'type': 'warning',
|
||||
@@ -14,14 +14,14 @@
|
||||
{% embed '_partials/_alert.html.twig' with { 'type': 'info' } %}
|
||||
{% block message %}
|
||||
{% if busEscort %}
|
||||
Mit den Fragen zur Busfahrt, wie bei einer Busbegleitung.
|
||||
Mit dem Bus-Feedback, wie bei einer Busbegleitung.
|
||||
{% else %}
|
||||
Ohne die Fragen zur Busfahrt, wie bei einem Einsatz ohne Busbegleitung.
|
||||
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' }} Busfahrt testen</a>
|
||||
<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">
|
||||
@@ -31,18 +31,22 @@
|
||||
'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="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 definition.description %}
|
||||
<p class="pb-8 text-gray-700">
|
||||
{{ definition.description|nl2br }}
|
||||
</p>
|
||||
{% endif %}
|
||||
{% if draft %}
|
||||
{% include '_partials/_alert.html.twig' with {
|
||||
'type': 'success',
|
||||
|
||||
@@ -173,6 +173,22 @@
|
||||
{%- endif -%}
|
||||
{%- endblock pickup_choice_widget -%}
|
||||
|
||||
{#
|
||||
# One questionnaire within a questionnaire form (App\Form\QuestionnaireType), which may hold
|
||||
# several: its title, its description and its sections.
|
||||
#}
|
||||
{%- block questionnaire_part_row -%}
|
||||
<section class="pb-4">
|
||||
<h2 class="text-2xl font-bold pb-2">{{ label }}</h2>
|
||||
{%- if help is not empty -%}
|
||||
<p class="pb-6 text-gray-700">{{ help|nl2br }}</p>
|
||||
{%- endif -%}
|
||||
{%- for child in form -%}
|
||||
{{- form_row(child) -}}
|
||||
{%- endfor -%}
|
||||
</section>
|
||||
{%- endblock questionnaire_part_row -%}
|
||||
|
||||
{#
|
||||
# A section of a questionnaire (App\Form\QuestionnaireType): its title and its questions. The
|
||||
# questions' rows carry data-question-key and, when conditional, data-show-if, which
|
||||
|
||||
@@ -1,17 +1,32 @@
|
||||
{% extends 'teamer/layout.html.twig' %}
|
||||
|
||||
{% block title %}{{ definition.title }}{% endblock %}
|
||||
{% block title %}Fragebogen zu deinem Einsatz{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1 class="text-2xl font-bold pb-4">
|
||||
{{ definition.title }}
|
||||
Fragebogen zu deinem Einsatz
|
||||
</h1>
|
||||
<p class="pb-8 text-gray-700">
|
||||
Abgeschickt am {{ response.submittedAt|date('d.m.Y, H:i') }} Uhr. Danke für dein Feedback!
|
||||
Danke für dein Feedback!
|
||||
</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 } %}
|
||||
<div class="lg:col-span-2 flex flex-col gap-y-12">
|
||||
{% for item in submitted %}
|
||||
<section>
|
||||
<h2 class="text-2xl font-bold pb-1">
|
||||
{{ item.definition.title }}
|
||||
</h2>
|
||||
<p class="pb-6 text-sm text-gray-500">
|
||||
Abgeschickt am {{ item.response.submittedAt|date('d.m.Y, H:i') }} Uhr
|
||||
</p>
|
||||
{% include 'questionnaire/_answers.html.twig' with { 'definition': item.definition, 'answers': item.response.answers } %}
|
||||
</section>
|
||||
{% endfor %}
|
||||
{% if open %}
|
||||
<a href="{{ path('app_teamer_questionnaire_edit', { 'uuid': disposition.uuid }) }}" class="btn inline-block self-start">
|
||||
Offenen Fragebogen ausfüllen
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div>
|
||||
<h2 class="text-lg font-bold pb-4">
|
||||
|
||||
@@ -1,16 +1,11 @@
|
||||
{% extends 'teamer/layout.html.twig' %}
|
||||
|
||||
{% block title %}{{ definition.title }}{% endblock %}
|
||||
{% block title %}Fragebogen zu deinem Einsatz{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1 class="text-2xl font-bold pb-4">
|
||||
{{ definition.title }}
|
||||
<h1 class="text-2xl font-bold pb-8">
|
||||
Fragebogen zu deinem Einsatz
|
||||
</h1>
|
||||
{% if definition.description %}
|
||||
<p class="pb-8 text-gray-700">
|
||||
{{ definition.description|nl2br }}
|
||||
</p>
|
||||
{% endif %}
|
||||
<div class="grid lg:grid-cols-3 gap-8 items-start">
|
||||
<div class="lg:col-span-2">
|
||||
{% include 'questionnaire/_form.html.twig' %}
|
||||
@@ -20,9 +15,9 @@
|
||||
Dein Einsatz
|
||||
</h2>
|
||||
{% include '_partials/_assignment_info.html.twig' with { 'assignment': disposition.assignment } %}
|
||||
{% if response %}
|
||||
{% if lastSaved %}
|
||||
<p class="pt-6 text-sm text-gray-500">
|
||||
Entwurf zuletzt gespeichert am {{ (response.updatedAt ?? response.createdAt)|date('d.m.Y, H:i') }} Uhr
|
||||
Entwurf zuletzt gespeichert am {{ lastSaved|date('d.m.Y, H:i') }} Uhr
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user