feat: add mailing templates and mail the confirmed teamers of selected assignments
This commit is contained in:
1 parent
6c89f1b8a9
commit
e285646bb2
57 files changed
+3525
-31
No files matched your search
@@ -0,0 +1,14 @@
|
||||
{# The placeholders of the teamer mailing, listed under every editor that writes one. #}
|
||||
<div class="text-sm text-gray-500">
|
||||
<div class="pb-2">
|
||||
Platzhalter für Betreff und Nachricht, sie werden beim Senden pro Person ersetzt:
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
{% for placeholder, label in placeholders %}
|
||||
<span class="inline-flex items-center space-x-1 py-1 px-2 bg-gray-50 border border-gray-200 rounded-sm">
|
||||
<code>{{ placeholder }}</code>
|
||||
<span>{{ label }}</span>
|
||||
</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,26 @@
|
||||
{# Files dropped earlier and still waiting in the upload session. The dropzone forgets them when
|
||||
the page is rendered again - after a failed save, say - but the next save still takes them, so
|
||||
they are listed here and can be dropped one by one. #}
|
||||
{% if uploads is not empty %}
|
||||
<div class="pb-2">
|
||||
<div class="text-sm text-gray-500 pb-1">
|
||||
Bereits hochgeladen:
|
||||
</div>
|
||||
<ul class="flex flex-col space-y-1">
|
||||
{% for upload in uploads %}
|
||||
<li class="flex items-center space-x-2 bg-gray-100 border rounded-sm px-2 py-1">
|
||||
{{ icon('document', 'w-4 h-4 shrink-0') }}
|
||||
<span class="flex-1">{{ upload.originalFilename }}</span>
|
||||
<span class="text-sm text-gray-500">{{ upload.size|file_size(1) }}</span>
|
||||
<button type="button"
|
||||
title="Datei entfernen"
|
||||
hx-delete="{{ path('app_upload_delete', { 'uuid': upload.uuid }) }}"
|
||||
hx-target="closest li"
|
||||
hx-swap="delete">
|
||||
{{ icon('delete', 'w-5 h-5') }}
|
||||
</button>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -55,18 +55,8 @@
|
||||
{{ include('_partials/_markdown_hint.html.twig') }}
|
||||
</div>
|
||||
|
||||
<div class="pb-8 text-sm text-gray-500">
|
||||
<div class="pb-2">
|
||||
Platzhalter für Betreff und Nachricht, sie werden beim Senden pro Person ersetzt:
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
{% for placeholder, label in placeholders %}
|
||||
<span class="inline-flex items-center space-x-1 py-1 px-2 bg-gray-50 border border-gray-200 rounded-sm">
|
||||
<code>{{ placeholder }}</code>
|
||||
<span>{{ label }}</span>
|
||||
</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="pb-8">
|
||||
{{ include('_partials/_mailing_placeholders.html.twig', { 'placeholders': placeholders }) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -23,6 +23,19 @@
|
||||
</button>
|
||||
|
||||
<div class="flex items-center space-x-2">
|
||||
{# The checkboxes in the table name this form, which sits outside the table so
|
||||
none of the htmx buttons in the rows posts the selection along. #}
|
||||
<form id="assignment-mailing-select" method="get" action="{{ path('app_administrative_assignment_mailing_compose') }}">
|
||||
<input type="hidden" name="r" value="{{ return_url() }}">
|
||||
{# starts a new mailing even with nothing ticked, rather than reopening the last draft #}
|
||||
<input type="hidden" name="start" value="1">
|
||||
<button type="submit"
|
||||
class="btn btn--small btn--secondary"
|
||||
title="Mail an die bestätigten Teamer:innen der ausgewählten Einsätze">
|
||||
{{ icon('mail', 'w-4 h-4 shrink-0') }}
|
||||
<span class="whitespace-nowrap">Mail an Teamer:innen</span>
|
||||
</button>
|
||||
</form>
|
||||
<a href="{{ path('app_administrative_assignment_create', { 'r': return_url() }) }}" class="btn btn--small">
|
||||
Neu
|
||||
</a>
|
||||
@@ -40,6 +53,9 @@
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<span class="sr-only">Für Mail auswählen</span>
|
||||
</th>
|
||||
<th>
|
||||
{{ knp_pagination_sortable(pagination, 'ID', ['assignment.id']) }}
|
||||
</th>
|
||||
@@ -72,6 +88,15 @@
|
||||
<tbody>
|
||||
{% for assignment in pagination %}
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox"
|
||||
name="assignments[]"
|
||||
value="{{ assignment.uuid }}"
|
||||
form="assignment-mailing-select"
|
||||
class="h-4 w-4 rounded-sm text-primary border-gray-300 focus:ring-primary"
|
||||
title="Für Mail auswählen"
|
||||
aria-label="Einsatz {{ assignment.id }} für Mail auswählen">
|
||||
</td>
|
||||
<td>
|
||||
{{ assignment.id }}
|
||||
</td>
|
||||
@@ -226,7 +251,7 @@
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="8">
|
||||
<td colspan="9">
|
||||
Keine Daten...
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
{# Swapped as a whole whenever an assignment is added or removed, so the recipient count is
|
||||
always the one for the list shown with it. #}
|
||||
<div id="mailing-assignments" class="pb-6">
|
||||
<div class="text-xl font-bold">
|
||||
{{ recipients.eligibleCount }} Empfänger:innen
|
||||
</div>
|
||||
<div class="text-sm text-gray-500">
|
||||
Teamer:innen mit bestätigter Einteilung, auch auf mehreren Einsätzen nur eine Mail.
|
||||
Einsätze ohne bestätigte Teamer:innen werden weggelassen.
|
||||
{% if recipients.hasSkipped %}
|
||||
{{ include('admin/teamer/_mailing_skipped.html.twig', { 'recipients': recipients }) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if recipients.eligibleCount > 0 %}
|
||||
<div class="pt-2 text-sm">
|
||||
{{ recipients.eligible|map(recipient => recipient.fullName)|join(', ') }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<ul class="flex flex-col space-y-1 py-4">
|
||||
{% for assignment in mailingDto.assignments %}
|
||||
<li class="flex items-center space-x-2 border rounded-sm px-2 py-1">
|
||||
{{ icon('flag-' ~ assignment.destination.country, 'w-5 h-5 shrink-0') }}
|
||||
<div class="flex-1">
|
||||
<span class="whitespace-nowrap">
|
||||
{{ assignment.destination.dateFrom|date('d.m.Y') }} - {{ assignment.destination.dateTo|date('d.m.Y') }}
|
||||
</span>
|
||||
{{ assignment.destination.hotel }}, {{ assignment.jobProfile.name }}
|
||||
{# who is confirmed here, so a teamer on two of the assignments - counted once
|
||||
above - is plain to see. Never empty: assignments nobody is confirmed on are
|
||||
left out of the mailing, see AssignmentRepository::findForMailing(). #}
|
||||
<div class="text-sm text-gray-500">
|
||||
bestätigt: {{ assignment.dispositions
|
||||
|filter(disposition => disposition.status == constant('App\\Entity\\Disposition::STATUS_CONFIRMED'))
|
||||
|map(disposition => disposition.teamer.fullName)
|
||||
|join(', ') }}
|
||||
</div>
|
||||
</div>
|
||||
<button type="button"
|
||||
class="text-red-500"
|
||||
title="Einsatz entfernen"
|
||||
hx-post="{{ path('app_administrative_assignment_mailing_remove', { 'uuid': assignment.uuid }) }}"
|
||||
hx-target="#mailing-assignments"
|
||||
hx-swap="outerHTML">
|
||||
{{ icon('delete', 'w-5 h-5') }}
|
||||
</button>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="text-gray-500">
|
||||
Noch kein Einsatz ausgewählt.
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
{# Its own form, outside the mailing form: forms cannot nest, and typing here must not park
|
||||
the search as a draft. The autocomplete dispatches a "select" event of its own; the
|
||||
[detail] filter keeps out the native one a text selection in the input fires. #}
|
||||
{{ form_start(addForm, { 'action': path('app_administrative_assignment_mailing_add') }) }}
|
||||
{{ form_row(addForm.assignment, { 'attr': {
|
||||
'hx-post': path('app_administrative_assignment_mailing_add'),
|
||||
'hx-trigger': 'select[detail]',
|
||||
'hx-target': '#mailing-assignments',
|
||||
'hx-swap': 'outerHTML',
|
||||
} }) }}
|
||||
{{ form_rest(addForm) }}
|
||||
{{ form_end(addForm) }}
|
||||
</div>
|
||||
@@ -0,0 +1,22 @@
|
||||
{# The template's files, swapped when a template is picked. The files dropped for this mailing
|
||||
are listed outside of it, by the dropzone, which a swap would otherwise empty. #}
|
||||
<div id="mailing-attachments" {% if oob|default(false) %}hx-swap-oob="true"{% endif %}>
|
||||
{% if mailingDto.template and mailingDto.template.attachments is not empty %}
|
||||
<div class="text-sm text-gray-500 pb-1">
|
||||
Aus der Vorlage, gehen immer mit:
|
||||
</div>
|
||||
<ul class="flex flex-col space-y-1 pb-2">
|
||||
{% for attachment in mailingDto.template.attachments %}
|
||||
<li class="flex items-center space-x-2 border rounded-sm px-2 py-1">
|
||||
{{ icon('document', 'w-4 h-4 shrink-0') }}
|
||||
<a href="{{ path('app_common_download', { 'uuid': attachment.uuid, 'inline': 1 }) }}"
|
||||
target="_blank"
|
||||
class="flex-1 underline">
|
||||
{{ attachment.displayName ?? attachment.originalFilename }}
|
||||
</a>
|
||||
<span class="text-sm text-gray-500">{{ attachment.size|file_size(1) }}</span>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -0,0 +1,5 @@
|
||||
{# Swapped when a template is picked, which replaces subject and message. #}
|
||||
<div id="mailing-fields" class="flex flex-col space-y-4 pb-4">
|
||||
{{ form_row(form.subject) }}
|
||||
{{ form_row(form.message) }}
|
||||
</div>
|
||||
@@ -0,0 +1,119 @@
|
||||
{% extends 'administrative/layout.html.twig' %}
|
||||
|
||||
{% block title %}Mail an Teamer:innen{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="flex items-start justify-between pb-4">
|
||||
<h1 class="text-2xl font-bold">
|
||||
Mail an die Teamer:innen von Einsätzen
|
||||
</h1>
|
||||
<a href="{{ returnUrl }}" class="btn btn--small btn--secondary shrink-0">
|
||||
Zurück zur Einsatzübersicht
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="grid lg:grid-cols-2 gap-8 items-start">
|
||||
<div>
|
||||
{{ include('administrative/assignment_mailing/_assignments.html.twig') }}
|
||||
|
||||
{# Outside the mailing form, so picking a template is not also parked as a draft
|
||||
by the form's input trigger - the template route parks it itself. #}
|
||||
<div class="pb-4">
|
||||
<label for="mailing-template" class="block font-bold pb-2">
|
||||
Vorlage
|
||||
</label>
|
||||
<select id="mailing-template"
|
||||
name="template"
|
||||
class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-xs ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset focus:ring-primary text-sm"
|
||||
hx-post="{{ path('app_administrative_assignment_mailing_template') }}"
|
||||
hx-trigger="change"
|
||||
hx-include="#mailing-form"
|
||||
hx-target="#mailing-fields"
|
||||
hx-swap="outerHTML">
|
||||
<option value="">keine Vorlage</option>
|
||||
{% for template in templates %}
|
||||
<option value="{{ template.uuid }}" {% if mailingDto.template and mailingDto.template.uuid == template.uuid %}selected{% endif %}>
|
||||
{{ template.name }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div class="pt-1 text-sm text-gray-500">
|
||||
Betreff und Nachricht der Vorlage ersetzen, was oben steht. Änderungen hier gelten
|
||||
nur für diese Mail, die Vorlage bleibt, wie sie ist.
|
||||
<a href="{{ path('app_administrative_system_mailing_template_index') }}" class="underline">Vorlagen verwalten</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# The draft trigger works as in the teamer mailing, see the comment there. #}
|
||||
{% set guardAttr = stimulus_controller('form-upload-guard')|stimulus_action('form-upload-guard', 'guard', 'submit') %}
|
||||
{{ form_start(form, { 'attr': {
|
||||
'id': 'mailing-form',
|
||||
'hx-post': path('app_administrative_assignment_mailing_draft'),
|
||||
'hx-trigger': 'input delay:500ms',
|
||||
'hx-target': '#mailing-preview',
|
||||
'hx-swap': 'innerHTML',
|
||||
'hx-indicator': '#mailing-preview-indicator',
|
||||
}|merge(guardAttr.toArray()) }) }}
|
||||
{{ include('administrative/assignment_mailing/_fields.html.twig') }}
|
||||
|
||||
<div class="flex flex-col space-y-4 pb-6">
|
||||
{{ include('_partials/_mailing_placeholders.html.twig', { 'placeholders': placeholders }) }}
|
||||
{{ include('_partials/_markdown_hint.html.twig') }}
|
||||
</div>
|
||||
|
||||
<div class="pb-8">
|
||||
<div class="font-bold">
|
||||
Anhänge
|
||||
</div>
|
||||
<div class="pb-2 text-sm text-gray-500">
|
||||
Nur PDF, bis 5 MB je Datei und {{ maxAttachmentBytes|file_size(0) }} zusammen.
|
||||
</div>
|
||||
{{ include('administrative/assignment_mailing/_attachments.html.twig') }}
|
||||
{{ include('_partials/_pending_uploads.html.twig', { 'uploads': pending }) }}
|
||||
{% include '_partials/_upload_collection_form.html.twig' with {
|
||||
'endpoint_upload': path('_uploader_upload_mailing_attachment'),
|
||||
'max_filesize': 5,
|
||||
'accepted_files': 'application/pdf',
|
||||
} %}
|
||||
</div>
|
||||
|
||||
<div class="flex items-center space-x-2 pb-8">
|
||||
<button type="button"
|
||||
class="btn"
|
||||
hx-post="{{ path('app_administrative_assignment_mailing_confirm') }}"
|
||||
hx-include="closest form"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend"
|
||||
{{ stimulus_target('form-upload-guard', 'submit') }}>
|
||||
{{ icon('mail', 'w-4 h-4 shrink-0') }}
|
||||
<span>Senden</span>
|
||||
</button>
|
||||
<button type="submit" class="btn btn--secondary" {{ stimulus_target('form-upload-guard', 'submit') }}>
|
||||
Vorschau an mich senden
|
||||
</button>
|
||||
{% if hasDraft %}
|
||||
<a href="{{ path('app_administrative_assignment_mailing_discard') }}" class="btn btn--secondary">
|
||||
Entwurf verwerfen
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{{ form_rest(form) }}
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
|
||||
<div class="lg:sticky lg:top-4">
|
||||
<div class="font-bold pb-2">
|
||||
Vorschau
|
||||
</div>
|
||||
<div class="relative">
|
||||
<div id="mailing-preview">
|
||||
{{ include('admin/teamer/_mailing_preview.html.twig', preview) }}
|
||||
</div>
|
||||
<div class="htmx-indicator absolute inset-0 bg-white/75 flex items-center justify-center"
|
||||
id="mailing-preview-indicator">
|
||||
{{ include('_partials/_spinner.html.twig', { 'class': 'w-8 h-8' }) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,56 @@
|
||||
{% extends 'htmx_confirmation_modal.html.twig' %}
|
||||
|
||||
{% set sendable = valid and attachmentError is null and recipients.eligibleCount > 0 %}
|
||||
|
||||
{% block title %}Mail wirklich senden?{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% if not valid %}
|
||||
<div class="pb-4">
|
||||
Betreff und Nachricht müssen ausgefüllt sein, bevor die Mail gesendet werden kann.
|
||||
</div>
|
||||
{% elseif attachmentError is not null %}
|
||||
<div class="pb-4">
|
||||
{{ attachmentError }}
|
||||
</div>
|
||||
{% elseif recipients.eligibleCount == 0 %}
|
||||
<div class="pb-4">
|
||||
Auf den ausgewählten Einsätzen ist niemand bestätigt eingeteilt, dem geschrieben werden kann.
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="pb-4">
|
||||
Die Mail geht an <strong>{{ recipients.eligibleCount }}</strong> Teamer:innen auf
|
||||
{{ mailingDto.assignments|length }} {{ mailingDto.assignments|length == 1 ? 'Einsatz' : 'Einsätzen' }}.
|
||||
Das lässt sich nicht zurücknehmen.
|
||||
</div>
|
||||
<div class="p-4 bg-gray-50 border border-gray-200 rounded-md">
|
||||
<div class="font-bold pb-2">{{ mailingDto.subject }}</div>
|
||||
<div class="text-sm">{{ mailingDto.message | u.truncate(400, '…', false) | nl2br }}</div>
|
||||
</div>
|
||||
{% set attachmentNames = (mailingDto.template ? mailingDto.template.attachments|map(a => a.displayName ?? a.originalFilename) : [])|merge(pending|map(u => u.originalFilename)) %}
|
||||
{% if attachmentNames is not empty %}
|
||||
<div class="pt-4 text-sm">
|
||||
<span class="font-bold">Anhänge ({{ attachmentSize|file_size(1) }}):</span>
|
||||
{{ attachmentNames|join(', ') }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if recipients.hasSkipped %}
|
||||
<div class="pt-4 text-sm text-gray-500">
|
||||
{{ include('admin/teamer/_mailing_skipped.html.twig', { 'recipients': recipients }) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div id="mailing-confirm-fields" class="hidden">
|
||||
<input type="hidden" name="{{ field_name(form.subject) }}" value="{{ field_value(form.subject) }}">
|
||||
{# a textarea keeps the line breaks of the message intact #}
|
||||
<textarea name="{{ field_name(form.message) }}">{{ field_value(form.message) }}</textarea>
|
||||
{% if form._token is defined %}
|
||||
{{ form_widget(form._token) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{# without a sendable mail there is nothing to confirm, the button only leads back to the draft #}
|
||||
{% block button_confirm %}{{ sendable ? 'Jetzt senden' : 'Zurück zum Entwurf' }}{% endblock %}
|
||||
|
||||
{% block button_attribute %}{% if sendable %}hx-post="{{ path('app_administrative_assignment_mailing_send') }}" hx-include="#mailing-confirm-fields"{% else %}{{ stimulus_action('modal', 'close') }}{% endif %}{% endblock %}
|
||||
@@ -0,0 +1,5 @@
|
||||
{{ include('administrative/assignment_mailing/_fields.html.twig') }}
|
||||
{{ include('administrative/assignment_mailing/_attachments.html.twig', { 'oob': true }) }}
|
||||
<div id="mailing-preview" hx-swap-oob="true">
|
||||
{{ include('admin/teamer/_mailing_preview.html.twig', preview) }}
|
||||
</div>
|
||||
@@ -0,0 +1,59 @@
|
||||
{% set formAttr = stimulus_controller('form-upload-guard')|stimulus_action('form-upload-guard', 'guard', 'submit') %}
|
||||
{{ form_start(form, { 'attr': formAttr.toArray() }) }}
|
||||
{{ form_errors(form) }}
|
||||
<div class="flex flex-col space-y-4 pb-4">
|
||||
{{ form_row(form.name) }}
|
||||
{{ form_row(form.subject) }}
|
||||
{{ form_row(form.message) }}
|
||||
</div>
|
||||
<div class="flex flex-col space-y-4 pb-8">
|
||||
{{ include('_partials/_mailing_placeholders.html.twig', { 'placeholders': placeholders }) }}
|
||||
{{ include('_partials/_markdown_hint.html.twig') }}
|
||||
</div>
|
||||
|
||||
<div class="pb-8">
|
||||
<div class="font-bold">
|
||||
Anhänge
|
||||
</div>
|
||||
<div class="pb-2 text-sm text-gray-500">
|
||||
Sie gehen mit jeder Mail aus dieser Vorlage mit. Nur PDF, bis 5 MB je Datei und
|
||||
{{ maxAttachmentBytes|file_size(0) }} zusammen.
|
||||
</div>
|
||||
{% if form.removeAttachments is defined %}
|
||||
<ul class="flex flex-col space-y-1 pb-2">
|
||||
{% for choice in form.removeAttachments %}
|
||||
{% set attachment = template.attachments|filter(a => a.uuid == choice.vars.value)|first %}
|
||||
<li class="flex items-center space-x-2 border rounded-sm px-2 py-1">
|
||||
{{ icon('document', 'w-4 h-4 shrink-0') }}
|
||||
<a href="{{ path('app_common_download', { 'uuid': attachment.uuid, 'inline': 1 }) }}"
|
||||
target="_blank"
|
||||
class="flex-1 underline">
|
||||
{{ choice.vars.label }}
|
||||
</a>
|
||||
<span class="text-sm text-gray-500">{{ attachment.size|file_size(1) }}</span>
|
||||
<label class="flex items-center space-x-1 text-sm">
|
||||
{{ form_widget(choice) }}
|
||||
<span>entfernen</span>
|
||||
</label>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{{ include('_partials/_pending_uploads.html.twig', { 'uploads': pending }) }}
|
||||
{% include '_partials/_upload_collection_form.html.twig' with {
|
||||
'endpoint_upload': path('_uploader_upload_mailing_template'),
|
||||
'max_filesize': 5,
|
||||
'accepted_files': 'application/pdf',
|
||||
} %}
|
||||
</div>
|
||||
|
||||
<div class="flex items-center space-x-2">
|
||||
<button type="submit" class="btn" {{ stimulus_target('form-upload-guard', 'submit') }}>
|
||||
Speichern
|
||||
</button>
|
||||
<a href="{{ path('app_administrative_system_mailing_template_index') }}" class="btn btn--secondary">
|
||||
Abbrechen
|
||||
</a>
|
||||
</div>
|
||||
{{ form_rest(form) }}
|
||||
{{ form_end(form) }}
|
||||
@@ -0,0 +1,12 @@
|
||||
{% extends 'administrative/layout.html.twig' %}
|
||||
|
||||
{% block title %}Einstellungen - Mailvorlage anlegen{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="max-w-screen-md">
|
||||
<h1 class="text-2xl font-bold pb-8">
|
||||
Mailvorlage anlegen
|
||||
</h1>
|
||||
{% include 'administrative/system/mailing_template/_form.html.twig' %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,12 @@
|
||||
{% extends 'administrative/layout.html.twig' %}
|
||||
|
||||
{% block title %}Einstellungen - Mailvorlage bearbeiten{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="max-w-screen-md">
|
||||
<h1 class="text-2xl font-bold pb-8">
|
||||
Mailvorlage bearbeiten
|
||||
</h1>
|
||||
{% include 'administrative/system/mailing_template/_form.html.twig' %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,81 @@
|
||||
{% extends 'administrative/layout.html.twig' %}
|
||||
|
||||
{% block title %}Einstellungen - Mailvorlagen{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1 class="text-2xl font-bold pb-2">
|
||||
Mailvorlagen
|
||||
</h1>
|
||||
<div class="pb-8 text-gray-500">
|
||||
Vorlagen für Mails an die Teamer:innen von Einsätzen. Die Einsätze wählst du in der
|
||||
Einsatzübersicht aus.
|
||||
</div>
|
||||
<div class="data-table-wrapper">
|
||||
<div class="data-table-wrapper__inner">
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-1/4">
|
||||
Name
|
||||
</th>
|
||||
<th class="w-2/5">
|
||||
Betreff
|
||||
</th>
|
||||
<th>
|
||||
Anhänge
|
||||
</th>
|
||||
<th>
|
||||
Geändert
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for template in templates %}
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{ path('app_administrative_system_mailing_template_edit', { 'uuid': template.uuid }) }}">
|
||||
{{ template.name }}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
{{ template.subject }}
|
||||
</td>
|
||||
<td>
|
||||
{{ template.attachments|length }}
|
||||
</td>
|
||||
<td class="whitespace-nowrap">
|
||||
{{ (template.updatedAt ?? template.createdAt)|date('d.m.Y') }}
|
||||
</td>
|
||||
<td>
|
||||
<div class="flex items-center space-x-2 justify-end">
|
||||
<button type="button"
|
||||
class="text-red-500"
|
||||
title="Mailvorlage löschen"
|
||||
hx-get="{{ path('app_administrative_system_mailing_template_delete', { 'uuid': template.uuid }) }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
{{ icon('delete') }}
|
||||
</button>
|
||||
<a href="{{ path('app_administrative_system_mailing_template_edit', { 'uuid': template.uuid }) }}"
|
||||
title="Mailvorlage bearbeiten">
|
||||
{{ icon('edit') }}
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="5">
|
||||
Keine Daten...
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<a href="{{ path('app_administrative_system_mailing_template_create') }}" class="btn">
|
||||
Neu
|
||||
</a>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,8 @@
|
||||
{% extends 'htmx_confirmation_modal.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<div>
|
||||
Möchtest du die Mailvorlage <em>{{ template.name }}</em> wirklich löschen? Bereits
|
||||
gesendete Mails bleiben davon unberührt.
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user