{% extends "orga/mails/base.html" %}
{% load bootstrap4 %}
{% load i18n %}
{% block mail_content %}
    {% if placeholders %}
    <div class="alert alert-info">
        {% blocktrans trimmed %}
            You have some variables available that will be rendered into the mails
            (in the appropriate language) before sending:
        {% endblocktrans %}
        <ul>
        {% for placeholder in placeholders %}
            <li>{{ placeholder.name }}{% if placeholder.explanation %}: {{ placeholder.explanation }}{% endif %}</li>
        {% endfor %}
        </ul>
    </div>
    {% endif %}

    <form method="post" action="">
        {% csrf_token %}
        <legend>{% trans "Mail Template Editor" %}</legend>
        {% bootstrap_form form layout='event' %}
        <div class="form-group row">
            <div class="ml-auto col-md-9">
                {% if action == "create" %}
                    <button type="submit" class="btn btn-primary">{% trans "Create template" %}</button>
                {% elif action == "edit" %}
                    <button type="submit" class="btn btn-primary">{% trans "Save" %}</button>
                {% endif %}
            </div>
        </div>
    </form>

{% endblock %}
