{% extends theme('base.html') %}
{% import 'fomanticui.html' as sui %}

{% block content %}
    <div class="ui segment">
        <h2 class="ui center aligned header">
            <div class="content">
                {{ _("Mail sending test") }}
            </div>
        </h2>

        <div class="ui info message">
            {% trans -%}
                This form will send a fake invitation email to the address you want.
                This should be used for testing mail configuration.
            {%- endtrans %}
        </div>

        {% call sui.render_form(form) %}
            {{ sui.render_fields(form) }}
            <div class="ui right aligned container">
                <div class="ui stackable buttons">
                    <input type="submit" class="ui primary button" value="{{ _("Send") }}">
                </div>
            </div>
        {% endcall %}
    </div>

    <div class="ui segment">
        <h2 class="ui center aligned header">
            <div class="content">
                {{ _("Email preview") }}
            </div>
        </h2>
        <div class="ui middle aligned divided list">
            <div class="item">
                <div class="right floated content">
                    <div class="ui buttons">
                        <a class="ui button" href="{{ url_for("admin.password_init_txt") }}">TXT</a>
                        <a class="ui button" href="{{ url_for("admin.password_init_html") }}">HTML</a>
                    </div>
                </div>
                <div class="middle aligned content">
                    {{ _("Password initialization") }}
                </div>
            </div>

            <div class="item">
                <div class="right floated content">
                    <div class="ui buttons">
                        <a class="ui button" href="{{ url_for("admin.password_reset_txt") }}">TXT</a>
                        <a class="ui button" href="{{ url_for("admin.password_reset_html") }}">HTML</a>
                    </div>
                </div>
                <div class="middle aligned content">
                    {{ _("Password reset") }}
                </div>
            </div>

            <div class="item">
                <div class="right floated content">
                    <div class="ui buttons">
                        <a class="ui button" href="{{ url_for("admin.invitation_txt", uid=user.uid, email=user.mail[0]) }}">TXT</a>
                        <a class="ui button" href="{{ url_for("admin.invitation_html", uid=user.uid, email=user.mail[0]) }}">HTML</a>
                    </div>
                </div>
                <div class="middle aligned content">
                    {{ _("Invitation") }}
                </div>
            </div>

        </div>
    </div>
{% endblock %}
