{% extends 'core/page.html' %}
{% load i18n %}

{% block page %}

    <h1>{% trans "Contact Form" %}</h1>

    {% if user.is_authenticated %}
        <p>
            {% trans "Please enter your message." %}
            {% blocktrans with email=user.email trimmed %}
            The answer will be sent to <b>{{ email }}</b>.
            {% endblocktrans %}
        </p>

        <form method="post" action="{% url 'contact:contact' %}" novalidate>
            {% csrf_token %}
            <input type="hidden" name="next" value="{{ next }}" />

            {{ form }}

            <input type="submit" value="{% trans 'Send message' %}" class="btn {{ submit_danger|yesno:'btn-danger,btn-primary' }}" />
            <input type="submit" name="cancel" value="{% trans 'Cancel' %}" class="btn btn-outline-secondary" />
        </form>
    {% else %}
        <p>
            {% trans "Please log in to be able to fill the contact form." %}
        </p>
    {% endif %}

{% endblock %}
