116 lines
5.6 KiB
Twig
116 lines
5.6 KiB
Twig
{% extends 'administrative/layout.html.twig' %}
|
|
|
|
{% block title %}Mail an Teamer:innen{% endblock %}
|
|
|
|
{% block content %}
|
|
{{ include('_partials/_back_link.html.twig', { 'url': returnUrl, 'label': 'zurück zur Einsatzübersicht' }) }}
|
|
<h1 class="text-2xl font-bold pb-4">
|
|
Mail an die Teamer:innen von Einsätzen
|
|
</h1>
|
|
|
|
<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-brand 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-primary"
|
|
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-secondary" {{ stimulus_target('form-upload-guard', 'submit') }}>
|
|
Vorschau an mich senden
|
|
</button>
|
|
{% if hasDraft %}
|
|
<a href="{{ path('app_administrative_assignment_mailing_discard') }}" class="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 %}
|