{% extends 'site/base.html' %}
{% load i18n %}

{% block content %}
<main class="account">
    <div class="narrow">
    <h2>{{ title }}</h2>
    {% if form_description %}<p>{{ form_description }}</p>{% endif %}

    {% include 'site/fragment_messages.html' %}

    {% if back_url %}
        <p><a href="{{ back_url }}?{{ request.META.QUERY_STRING }}">« {% trans 'back' %}</a></p>
    {% endif %}

    <form method="post" action="{{ request.path_info }}?{{ request.META.QUERY_STRING }}">
        {% csrf_token %}
        {{ form.as_p }}
        <button type="submit">{{ title }}</button>
        {% if sso_services %}
        {% for sso_service_id, sso_service_name in sso_services.items %}
            <a href="{% url "social:begin" sso_service_id %}?{{ redirect_query }}" class="button sso" target="_self">Login with {{ sso_service_name }}</a>
        {% endfor %}
        {% endif %}
        {% if bottom_link_url %}
            <a href="{{ bottom_link_url }}?{{ request.META.QUERY_STRING }}">{{ bottom_link_text }}</a>
        {% endif %}
    </form>
    </div>
</main>
{% endblock %}
