{% extends "orga/mails/base.html" %}
{% load bootstrap4 %}
{% load i18n %}

{% block mail_content %}
    <div class="alert alert-info">
        <div>
            <p>
                {% blocktranslate trimmed %}
                    You can edit the default templates and your custom templates for emails here.
                    If you want to send emails to some or all of your speakers, head over to the
                    "Send Emails" tab. Mails queued for sending are in the "Outbox" tab.
                {% endblocktranslate %}
            </p>
            <p>
                {% blocktranslate trimmed %}
                    There are different placeholders available depending on the template type.
                    They are explained in detail once you start editing a template.
                {% endblocktranslate %}
            </p>
        </div>
    </div>

    <div class="d-flex w-100 mb-3">
        <a href="{{ request.event.orga_urls.new_template }}" class="btn btn-success flip ml-auto btn-lg">
            <i class="fa fa-plus"></i>
            {% translate "New custom template" %}
        </a></div>

    <div>
        <hr class="mt-4 mb-4">
        <div>
            <div class="d-flex w-100 mb-3">
                <h3>{% translate "Acknowledge Mail" %}</h3>
                <a href="{{ ack.instance.urls.edit }}" class="btn btn-info flip ml-auto">{% translate "Edit template" %}</a>
            </div>
            {% bootstrap_form ack layout='event' %}
        </div>

        <hr class="mt-4 mb-4">

        <div>
            <div class="d-flex w-100 mb-3">
                <h3>{% translate "Accept Mail" %}</h3>
                <a href="{{ accept.instance.urls.edit }}" class="btn btn-info flip ml-auto">{% translate "Edit template" %}</a>
            </div>
            {% bootstrap_form accept layout='event' %}
        </div>

        <hr class="mt-4 mb-4">

        <div>
            <div class="d-flex w-100 mb-3">
                <h3>{% translate "Rejection Mail" %}</h3>
                <a href="{{ reject.instance.urls.edit }}" class="btn btn-info flip ml-auto">{% translate "Edit template" %}</a>
            </div>
            {% bootstrap_form reject layout='event' %}
        </div>

        <hr class="mt-4 mb-4">

        <div>
            <div class="d-flex w-100 mb-3">
                <h3>{% translate "New schedule version" %}</h3>
                <a href="{{ update.instance.urls.edit }}" class="btn btn-info flip ml-auto">{% translate "Edit template" %}</a>
            </div>
            {% bootstrap_form update layout='event' %}
        </div>

        <hr class="mt-4 mb-4">

        <div>
            <div class="d-flex w-100 mb-3">
                <h3>{% translate "Unanswered questions reminder" %}</h3>
                <a href="{{ remind.instance.urls.edit }}" class="btn btn-info flip ml-auto">{% translate "Edit template" %}</a>
            </div>
            {% bootstrap_form remind layout='event' %}
        </div>

        <hr class="mt-4 mb-4">

        {% for template in other %}
            <div>
                <div class="d-flex w-100 mb-3">
                    <h3>{% translate "Custom Mail" %}</h3>
                    <a href="{{ template.instance.urls.delete }}" class="btn btn-danger flip ml-auto mr-2">{% translate "Delete template" %}</a>
                    <a href="{{ template.instance.urls.edit }}" class="btn btn-info mr-2">{% translate "Edit template" %}</a>
                    <a href="{{ request.event.orga_urls.compose_mails }}?template={{ template.instance.pk }}" class="btn btn-success">{% translate "Send mails" %}</a>
                </div>
                {% bootstrap_form template layout='event' %}
            </div>
            <hr class="mt-4 mb-4">
        {% endfor %}
    </div>
{% endblock %}
