feat: review received form submissions in the admin ui
This commit is contained in:
1 parent
f073a2014d
commit
cb2d64f2cd
19 files changed
+999
-7
No files matched your search
@@ -0,0 +1,93 @@
|
||||
{% extends 'admin/layout.html.twig' %}
|
||||
|
||||
{% block title %}Eingegangenes Formular{% endblock %}
|
||||
|
||||
{% macro row(label, value) %}
|
||||
<div class="py-6 first:pt-0 last:pb-0 sm:grid sm:grid-cols-4 sm:gap-4">
|
||||
<dt class="text-sm font-bold leading-6 text-gray-900">
|
||||
{{ label }}
|
||||
</dt>
|
||||
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-3 sm:mt-0">
|
||||
{% if value is same as(true) %}
|
||||
ja
|
||||
{% elseif value is same as(false) %}
|
||||
nein
|
||||
{% elseif value is empty %}
|
||||
-
|
||||
{% else %}
|
||||
{{ value|nl2br }}
|
||||
{% endif %}
|
||||
</dd>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% block content %}
|
||||
<div class="flex items-start justify-between pb-8">
|
||||
<h1 class="text-2xl font-bold">
|
||||
{{ submission.formLabel }}
|
||||
{% if submission.lastName or submission.firstName %}
|
||||
- {{ [submission.firstName, submission.lastName]|filter(part => part is not empty)|join(' ') }}
|
||||
{% endif %}
|
||||
</h1>
|
||||
<a href="{{ returnUrl }}" class="btn btn--small btn--secondary">
|
||||
zurück
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="grid lg:grid-cols-2 gap-x-8 gap-y-4 pb-8">
|
||||
<dl class="divide-y divide-gray-100">
|
||||
{{ _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.birthDate) }}
|
||||
{{ _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(', ')) }}
|
||||
</dl>
|
||||
<dl class="divide-y divide-gray-100">
|
||||
{{ _self.row('Formularkennung', submission.form) }}
|
||||
{{ _self.row('Quelle', submission.pageUrl) }}
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<h2 class="font-bold text-lg pb-4">
|
||||
Bearbeitung
|
||||
</h2>
|
||||
<div class="grid lg:grid-cols-2 gap-x-8 gap-y-8 pb-8">
|
||||
<div>
|
||||
<dl class="divide-y divide-gray-100">
|
||||
{{ _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) }}
|
||||
</dl>
|
||||
</div>
|
||||
<div>
|
||||
{{ form_start(callsForm) }}
|
||||
<div class="flex flex-col space-y-2 pb-4">
|
||||
{{ form_row(callsForm.firstCallHeld) }}
|
||||
{% if submission.firstCallHeldAt %}
|
||||
<div class="text-sm">geführt am {{ submission.firstCallHeldAt|date('d.m.Y') }}</div>
|
||||
{% endif %}
|
||||
{{ form_row(callsForm.secondCallHeld) }}
|
||||
{% if submission.secondCallHeldAt %}
|
||||
<div class="text-sm">geführt am {{ submission.secondCallHeldAt|date('d.m.Y') }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{{ form_widget(callsForm.save, { 'attr': { 'class': 'btn btn--small' } }) }}
|
||||
{{ form_rest(callsForm) }}
|
||||
{{ form_end(callsForm) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2 class="font-bold text-lg pb-4">
|
||||
Angaben aus dem Formular
|
||||
</h2>
|
||||
{% if submission.details is empty %}
|
||||
<p>Das Formular hat über die Stammdaten hinaus nichts erfasst.</p>
|
||||
{% else %}
|
||||
<dl class="divide-y divide-gray-100">
|
||||
{% for label, answer in submission.details %}
|
||||
{{ _self.row(label, answer is iterable ? answer|join(', ') : answer) }}
|
||||
{% endfor %}
|
||||
</dl>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,133 @@
|
||||
{% extends 'admin/layout.html.twig' %}
|
||||
|
||||
{% block title %}Eingegangene Formulare{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="flex items-start justify-between pb-4">
|
||||
<h1 class="text-2xl font-bold">
|
||||
Eingegangene Formulare
|
||||
</h1>
|
||||
<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 }) }}"
|
||||
title="Filter"
|
||||
hx-get="{{ path('app_common_application_form_submission_filter', { 'r': return_url() }) }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
{{ icon('filter', 'w-4 h-4 shrink-0') }}
|
||||
{% if filterDto.active %}
|
||||
<span class="whitespace-nowrap">{{ filterDto.activeFiltersCount }} Filter aktiv</span>
|
||||
{% else %}
|
||||
<span>Filter</span>
|
||||
{% endif %}
|
||||
</button>
|
||||
{% if filterDto.active %}
|
||||
<a href="{{ path('app_common_application_form_submission_filter_reset') }}"
|
||||
class="btn btn--small btn--secondary">
|
||||
Reset
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="data-table-wrapper">
|
||||
<div class="data-table-wrapper__inner">
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
{{ knp_pagination_sortable(pagination, 'Name', 'submission.lastName') }}
|
||||
</th>
|
||||
<th>
|
||||
{{ knp_pagination_sortable(pagination, 'E-Mail', 'submission.email') }}
|
||||
</th>
|
||||
<th>
|
||||
{{ knp_pagination_sortable(pagination, 'Formular', 'submission.formLabel') }}
|
||||
</th>
|
||||
<th>
|
||||
{{ knp_pagination_sortable(pagination, 'eingegangen', 'submission.submittedAt') }}
|
||||
</th>
|
||||
<th>
|
||||
{{ knp_pagination_sortable(pagination, '1. Mail', 'submission.firstMailSentAt') }}
|
||||
</th>
|
||||
<th>
|
||||
{{ knp_pagination_sortable(pagination, '2. Mail', 'submission.secondMailSentAt') }}
|
||||
</th>
|
||||
<th>
|
||||
{{ knp_pagination_sortable(pagination, '1. Call', 'submission.firstCallHeldAt') }}
|
||||
</th>
|
||||
<th>
|
||||
{{ knp_pagination_sortable(pagination, '2. Call', 'submission.secondCallHeldAt') }}
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for submission in pagination %}
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{ path('app_admin_application_form_submission_detail', { 'uuid': submission.uuid, 'r': return_url() }) }}">
|
||||
{% if submission.lastName or submission.firstName %}
|
||||
{{ [submission.lastName, submission.firstName]|filter(part => part is not empty)|join(', ') }}
|
||||
{% else %}
|
||||
ohne Namen
|
||||
{% endif %}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
{% if submission.email %}
|
||||
<a href="mailto:{{ submission.email }}">{{ submission.email }}</a>
|
||||
{% else %}
|
||||
-
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{{ submission.formLabel }}
|
||||
</td>
|
||||
<td class="whitespace-nowrap">
|
||||
{{ submission.submittedAt|date('d.m.Y, H:i') }}
|
||||
</td>
|
||||
<td class="whitespace-nowrap">
|
||||
{{ submission.firstMailSentAt ? submission.firstMailSentAt|date('d.m.Y, H:i') : '-' }}
|
||||
</td>
|
||||
<td class="whitespace-nowrap">
|
||||
{{ submission.secondMailSentAt ? submission.secondMailSentAt|date('d.m.Y, H:i') : '-' }}
|
||||
</td>
|
||||
<td class="whitespace-nowrap">
|
||||
{{ submission.firstCallHeldAt ? submission.firstCallHeldAt|date('d.m.Y') : '-' }}
|
||||
</td>
|
||||
<td class="whitespace-nowrap">
|
||||
{{ submission.secondCallHeldAt ? submission.secondCallHeldAt|date('d.m.Y') : '-' }}
|
||||
</td>
|
||||
<td>
|
||||
<twig:DropDown>
|
||||
<a href="{{ path('app_admin_application_form_submission_detail', { 'uuid': submission.uuid, 'r': return_url() }) }}"
|
||||
class="text-gray-700 hover:text-primary block px-4 py-2 text-sm"
|
||||
role="menuitem"
|
||||
tabindex="-1">
|
||||
Details
|
||||
</a>
|
||||
<button type="button"
|
||||
class="text-red-500 hover:text-primary block px-4 py-2 text-sm w-full text-left"
|
||||
role="menuitem"
|
||||
tabindex="-1"
|
||||
hx-get="{{ path('app_admin_application_form_submission_delete', { 'uuid': submission.uuid, 'r': return_url() }) }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
löschen
|
||||
</button>
|
||||
</twig:DropDown>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="9">
|
||||
Keine Daten...
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{{ knp_pagination_render(pagination) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,14 @@
|
||||
{% extends 'htmx_confirmation_modal.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<div>
|
||||
Möchtest du das Formular <em>{{ submission.formLabel }}</em>
|
||||
{% if submission.lastName or submission.firstName %}
|
||||
von <em>{{ [submission.firstName, submission.lastName]|filter(part => part is not empty)|join(' ') }}</em>
|
||||
{% endif %}
|
||||
vom {{ submission.submittedAt|date('d.m.Y, H:i') }} wirklich löschen?
|
||||
<div class="pt-2 text-sm">
|
||||
Die Daten werden endgültig entfernt und können nicht wiederhergestellt werden.
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user