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,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 %}
|
||||
Reference in new issue
Block a user