From 99e611931101031fb775f4daf4eab85a61693548 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Thu, 12 Nov 2026 15:27:12 +0100 Subject: [PATCH] style: show the received form submission in cards with a processing aside --- .../detail.html.twig | 201 ++++++++++-------- 1 file changed, 113 insertions(+), 88 deletions(-) diff --git a/templates/admin/application_form_submission/detail.html.twig b/templates/admin/application_form_submission/detail.html.twig index 5c147ee..235fcb1 100644 --- a/templates/admin/application_form_submission/detail.html.twig +++ b/templates/admin/application_form_submission/detail.html.twig @@ -1,64 +1,97 @@ {% extends 'admin/layout.html.twig' %} +{% set name = [submission.firstName, submission.lastName]|filter(part => part is not empty)|join(' ') %} + {% block title %}Eingegangenes Formular{% endblock %} -{% macro row(label, value) %} -
-
- {{ label }} -
-
- {% if value is same as(true) %} - ja - {% elseif value is same as(false) %} - nein - {% elseif value is empty %} - - - {% else %} - {{ value|nl2br }} - {% endif %} -
-
+{% 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) %} +
+ {% for label, value in fields %} +
{{ label }}
+
{{ _self.value(value) }}
+ {% endfor %} +
{% endmacro %} {% block content %} {{ include('_partials/_back_link.html.twig', { 'url': returnUrl }) }} -

- {{ submission.formLabel }} - {% if submission.lastName or submission.firstName %} - - {{ [submission.firstName, submission.lastName]|filter(part => part is not empty)|join(' ') }} - {% endif %} +

+ {{ submission.formLabel }}{% if name %} - {{ name }}{% endif %}

+

+ eingegangen am {{ submission.submittedAt|date('d.m.Y, H:i') }} Uhr +

-
-
- {{ _self.row('eingegangen am', submission.submittedAt|date('d.m.Y, H:i')) }} - {{ _self.row('Name', [submission.firstName, submission.lastName]|filter(part => part is not empty)|join(' ')) }} - {{ _self.row('Geburtsdatum', submission.dateOfBirth ? submission.dateOfBirth|date('d.m.Y') : submission.birthDate) }} - {{ _self.row('Geschlecht', submission.gender) }} - {# 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" here. #} - {{ _self.row('EU (inkl. Schweiz)', submission.eu) }} - {{ _self.row('E-Mail', submission.email) }} - {{ _self.row('Telefon', submission.phone) }} - {{ _self.row('Mobil', submission.mobile) }} - {{ _self.row('Adresse', [submission.street, [submission.zipCode, submission.city]|filter(part => part is not empty)|join(' ')]|filter(part => part is not empty)|join(', ')) }} -
-
- {{ _self.row('Formularkennung', submission.form) }} - {{ _self.row('Quelle', submission.pageUrl) }} -
-
+
+
+
+

+ Stammdaten +

+ {{ _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". #} +
-

- Bearbeitung -

-
-
-
- {{ _self.row('1. Mail versendet', submission.firstMailSentAt ? submission.firstMailSentAt|date('d.m.Y, H:i') : null) }} - {{ _self.row('2. Mail versendet', submission.secondMailSentAt ? submission.secondMailSentAt|date('d.m.Y, H:i') : null) }} -
+
+

+ Angaben aus dem Formular +

+ {% if submission.details is empty %} +

Das Formular hat über die Stammdaten hinaus nichts erfasst.

+ {% else %} +
+ {% for label, answer in submission.details %} +
+
{{ label }}
+
{{ _self.value(answer is iterable ? answer|join(', ') : answer) }}
+
+ {% endfor %} +
+ {% endif %} +
+ +
+

+ Formular +

+ {{ _self.fields({ + 'Formularkennung': submission.form, + 'Quelle': submission.pageUrl, + }) }} +
+
+ +
-
+ +

+ Calls +

{{ form_start(callsForm) }} -
+
{{ form_row(callsForm.firstCallHeld) }} {% if submission.firstCallHeldAt %} -
geführt am {{ submission.firstCallHeldAt|date('d.m.Y') }}
+
geführt am {{ submission.firstCallHeldAt|date('d.m.Y') }}
{% endif %} {{ form_row(callsForm.secondCallHeld) }} {% if submission.secondCallHeldAt %} -
geführt am {{ submission.secondCallHeldAt|date('d.m.Y') }}
+
geführt am {{ submission.secondCallHeldAt|date('d.m.Y') }}
{% endif %}
{{ form_widget(callsForm.save, { 'attr': { 'class': 'btn-tool' } }) }} {{ form_rest(callsForm) }} {{ form_end(callsForm) }} -
-
-
- {{ _self.row('übernommen am', submission.teamerCreatedAt ? submission.teamerCreatedAt|date('d.m.Y, H:i') : null) }} -
+ +

+ Teamer:in +

+ {{ _self.fields({ + 'übernommen am': submission.teamerCreatedAt ? submission.teamerCreatedAt|date('d.m.Y, H:i') : null, + }, true) }}
{% if submission.user and submission.user.teamer %} + class="btn-secondary"> Teamer:innenprofil öffnen {% 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 #} - {% 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. #} -
- Die BusPro-Adresse {{ submission.busProAddressId }} wurde schon angelegt, - die Übernahme wurde aber nicht abgeschlossen. -
- {% endif %} {% else %} -
+

Ohne E-Mail-Adresse kann kein Teamer:innenkonto angelegt werden. -

+

{% endif %}
-
+
- -

- Angaben aus dem Formular -

- {% if submission.details is empty %} -

Das Formular hat über die Stammdaten hinaus nichts erfasst.

- {% else %} -
- {% for label, answer in submission.details %} - {{ _self.row(label, answer is iterable ? answer|join(', ') : answer) }} - {% endfor %} -
- {% endif %} {% endblock %}