178 lines
8.2 KiB
Twig
178 lines
8.2 KiB
Twig
{% extends 'admin/layout.html.twig' %}
|
|
|
|
{% set name = [submission.firstName, submission.lastName]|filter(part => part is not empty)|join(' ') %}
|
|
|
|
{% block title %}Eingegangenes Formular{% endblock %}
|
|
|
|
{% macro value(value) %}
|
|
{% if value is same as(true) %}
|
|
ja
|
|
{% elseif value is same as(false) %}
|
|
nein
|
|
{% elseif value is empty %}
|
|
-
|
|
{% else %}
|
|
{{ value|nl2br }}
|
|
{% endif %}
|
|
{% endmacro %}
|
|
|
|
{# label and value side by side, as on the teamer profile; `narrow` for the aside #}
|
|
{% macro fields(fields, narrow = false) %}
|
|
<dl class="{{ html_classes('grid gap-x-4 gap-y-2', { 'grid-cols-[minmax(0,10rem)_minmax(0,1fr)]': not narrow, 'grid-cols-[minmax(0,7rem)_minmax(0,1fr)]': narrow }) }}">
|
|
{% for label, value in fields %}
|
|
<dt class="text-muted">{{ label }}</dt>
|
|
<dd class="break-words">{{ _self.value(value) }}</dd>
|
|
{% endfor %}
|
|
</dl>
|
|
{% endmacro %}
|
|
|
|
{% block content %}
|
|
{{ include('_partials/_back_link.html.twig', { 'url': returnUrl }) }}
|
|
<h1 class="text-2xl font-bold pb-1">
|
|
{{ submission.formLabel }}{% if name %} - {{ name }}{% endif %}
|
|
</h1>
|
|
<p class="pb-6 text-muted">
|
|
eingegangen am {{ submission.submittedAt|date('d.m.Y, H:i') }} Uhr
|
|
</p>
|
|
|
|
<div class="grid lg:grid-cols-3 gap-6 items-start">
|
|
<div class="lg:col-span-2 flex flex-col gap-y-6">
|
|
<section class="card p-5">
|
|
<h2 class="section-title pb-4">
|
|
Stammdaten
|
|
</h2>
|
|
{{ _self.fields({
|
|
'Name': name,
|
|
'Geburtsdatum': submission.dateOfBirth ? submission.dateOfBirth|date('d.m.Y') : submission.birthDate,
|
|
'Geschlecht': submission.gender,
|
|
'EU (inkl. Schweiz)': submission.eu,
|
|
'E-Mail': submission.email,
|
|
'Telefon': submission.phone,
|
|
'Mobil': submission.mobile,
|
|
'Adresse': [submission.street, [submission.zipCode, submission.city]|filter(part => part is not empty)|join(' ')]|filter(part => part is not empty)|join(', '),
|
|
}) }}
|
|
{# EU has three states: the form said yes, said no, or never asked - and only the
|
|
first one earns the automatic receipt mail, so "-" is not the same as "nein". #}
|
|
</section>
|
|
|
|
<section class="card p-5">
|
|
<h2 class="section-title pb-2">
|
|
Angaben aus dem Formular
|
|
</h2>
|
|
{% if submission.details is empty %}
|
|
<p class="text-muted">Das Formular hat über die Stammdaten hinaus nichts erfasst.</p>
|
|
{% else %}
|
|
<dl class="divide-y divide-line">
|
|
{% for label, answer in submission.details %}
|
|
<div class="py-3 first:pt-1 last:pb-0 sm:grid sm:grid-cols-2 sm:gap-4">
|
|
<dt class="text-muted">{{ label }}</dt>
|
|
<dd class="mt-1 sm:mt-0 break-words">{{ _self.value(answer is iterable ? answer|join(', ') : answer) }}</dd>
|
|
</div>
|
|
{% endfor %}
|
|
</dl>
|
|
{% endif %}
|
|
</section>
|
|
|
|
<section class="card p-5">
|
|
<h2 class="section-title pb-4">
|
|
Formular
|
|
</h2>
|
|
{{ _self.fields({
|
|
'Formularkennung': submission.form,
|
|
'Quelle': submission.pageUrl,
|
|
}) }}
|
|
</section>
|
|
</div>
|
|
|
|
<aside class="card p-5">
|
|
<h2 class="section-title pb-3">
|
|
Mails
|
|
</h2>
|
|
{{ _self.fields({
|
|
'1. Mail': submission.firstMailSentAt ? submission.firstMailSentAt|date('d.m.Y, H:i') : null,
|
|
'2. Mail': submission.secondMailSentAt ? submission.secondMailSentAt|date('d.m.Y, H:i') : null,
|
|
}, true) }}
|
|
{% if submission.email %}
|
|
<div class="flex flex-wrap items-center gap-2 pt-4">
|
|
<button type="button"
|
|
class="btn-tool"
|
|
hx-get="{{ path('app_admin_application_form_submission_send_receipt', { 'uuid': submission.uuid, 'r': forwarded_return_url() }) }}"
|
|
hx-target="body"
|
|
hx-swap="beforeend">
|
|
Eingangsbestätigung erneut senden
|
|
</button>
|
|
<button type="button"
|
|
class="btn-tool"
|
|
hx-get="{{ path('app_admin_application_form_submission_send_follow_up', { 'uuid': submission.uuid, 'r': forwarded_return_url() }) }}"
|
|
hx-target="body"
|
|
hx-swap="beforeend">
|
|
{% if submission.secondMailSentAt %}
|
|
2. Mail erneut senden
|
|
{% else %}
|
|
2. Mail senden
|
|
{% endif %}
|
|
</button>
|
|
</div>
|
|
{% else %}
|
|
<p class="pt-4 text-muted">
|
|
Dieses Formular enthält keine E-Mail-Adresse - es kann keine Mail versendet werden.
|
|
</p>
|
|
{% endif %}
|
|
|
|
<h2 class="section-title mt-5 border-t border-line pt-4 pb-3">
|
|
Calls
|
|
</h2>
|
|
{{ form_start(callsForm) }}
|
|
<div class="flex flex-col gap-y-2 pb-4">
|
|
{{ form_row(callsForm.firstCallHeld) }}
|
|
{% if submission.firstCallHeldAt %}
|
|
<div class="-mt-1 pl-7 text-sm text-muted">geführt am {{ submission.firstCallHeldAt|date('d.m.Y') }}</div>
|
|
{% endif %}
|
|
{{ form_row(callsForm.secondCallHeld) }}
|
|
{% if submission.secondCallHeldAt %}
|
|
<div class="-mt-1 pl-7 text-sm text-muted">geführt am {{ submission.secondCallHeldAt|date('d.m.Y') }}</div>
|
|
{% endif %}
|
|
</div>
|
|
{{ form_widget(callsForm.save, { 'attr': { 'class': 'btn-tool' } }) }}
|
|
{{ form_rest(callsForm) }}
|
|
{{ form_end(callsForm) }}
|
|
|
|
<h2 class="section-title mt-5 border-t border-line pt-4 pb-3">
|
|
Teamer:in
|
|
</h2>
|
|
{{ _self.fields({
|
|
'übernommen am': submission.teamerCreatedAt ? submission.teamerCreatedAt|date('d.m.Y, H:i') : null,
|
|
}, true) }}
|
|
<div class="pt-4">
|
|
{% if submission.user and submission.user.teamer %}
|
|
<a href="{{ path('app_administrative_teamer_profile', { 'uuid': submission.user.teamer.uuid, 'r': forwarded_return_url() }) }}"
|
|
class="btn-secondary">
|
|
Teamer:innenprofil öffnen
|
|
</a>
|
|
{% elseif submission.email %}
|
|
{% if submission.busProAddressId %}
|
|
{# Step 1 is done and the rest is not: naming it here is what makes a
|
|
retry a resume rather than a guess. #}
|
|
{% include '_partials/_alert.html.twig' with {
|
|
type: 'warning',
|
|
message: 'Die BusPro-Adresse ' ~ submission.busProAddressId ~ ' wurde schon angelegt, die Übernahme wurde aber nicht abgeschlossen.',
|
|
} %}
|
|
{% endif %}
|
|
{# turning the application into a teamer is what this page is for #}
|
|
<button type="button"
|
|
class="btn-primary"
|
|
hx-get="{{ path('app_admin_application_form_submission_create_teamer', { 'uuid': submission.uuid, 'r': forwarded_return_url() }) }}"
|
|
hx-target="body"
|
|
hx-swap="beforeend">
|
|
Teamer:in anlegen
|
|
</button>
|
|
{% else %}
|
|
<p class="text-muted">
|
|
Ohne E-Mail-Adresse kann kein Teamer:innenkonto angelegt werden.
|
|
</p>
|
|
{% endif %}
|
|
</div>
|
|
</aside>
|
|
</div>
|
|
{% endblock %}
|