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

    <div class="alert alert-info">
        {% blocktrans 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.
        {% endblocktrans %}
    </div>

    <div class="alert"><a href="{{ request.event.orga_urls.new_template }}">
        <button class="btn btn-primary pull-right">{% trans "New custom template" %}</button>
    </a></div>

    <div>
    <div class="alert">
        {% csrf_token %}
        <legend>{% trans "Acknowledge Mail" %}</legend>
        {% bootstrap_form ack layout='event' %}
        <div><a href="{{ ack.instance.urls.edit }}">
            <button class="btn btn-primary pull-right">{% trans "Edit template" %}</button>
        </a></div>
    </div>
    <div class="alert">
        {% csrf_token %}
        <legend>{% trans "Accept Mail" %}</legend>
        {% bootstrap_form accept layout='event' %}
        <div><a href="{{ accept.instance.urls.edit }}">
            <button class="btn btn-primary pull-right">{% trans "Edit template" %}</button>
        </a></div>
    </div>
    <div class="alert">
        {% csrf_token %}
        <legend>{% trans "Rejection Mail" %}</legend>
        {% bootstrap_form reject layout='event' %}
        <div><a href="{{ reject.instance.urls.edit }}">
            <button class="btn btn-primary pull-right">{% trans "Edit template" %}</button>
        </a></div>
    </div>
    <div class="alert">
        {% csrf_token %}
        <legend>{% trans "Update Mail" %}</legend>
        {% bootstrap_form update layout='event' %}
        <div><a href="{{ update.instance.urls.edit }}">
            <button class="btn btn-primary pull-right">{% trans "Edit template" %}</button>
        </a></div>
    </div>

    {% for template in other %}
    <div class="alert">
        {% csrf_token %}
        <legend>{% trans "Custom Mail" %}</legend>
        {% bootstrap_form template layout='event' %}
        <div><a href="{{ template.instance.urls.delete }}">
            <button class="btn btn-danger">{% trans "Delete template" %}</button>
        </a></div>
        <div><a href="{{ template.instance.urls.edit }}">
            <button class="btn btn-primary pull-right">{% trans "Edit template" %}</button>
        </a></div>
    </div>
    {% endfor %}
    </div>

{% endblock %}
