{% extends "beam/base.html" %}

{% load crispy_forms_tags %}
{% load i18n %}

{% block title %}{% trans "Log in" %} | {{ block.super }}{% endblock %}

{% block content %}
    <h1>{% block heading %}{% trans "Log in" %}{% endblock %}</h1>
    {% if next %}
        {% if user.is_authenticated %}
            <p class="alert alert-warning">{% trans "Your account doesn't have access to this page. To proceed, please log in with an account that has access." %}</p>
        {% else %}
            <p class="alert alert-info">{% trans "Please log in to see this page." %}</p>
        {% endif %}
    {% endif %}

    <form method="post" action="{{ request.get_full_path }}">
        {% csrf_token %}
        {{ form|crispy }}
        <input type="submit" value="{% trans "Log in" %}" class="btn btn-primary">
        <input type="hidden" name="next" value="{{ next }}">
    </form>

    {# Assumes you setup the password_reset view in your URLconf #}
    {% url 'password_reset' as reset_url %}
    {% if reset_url %}
    <p><a href="{{ reset_url }}">{% trans "Forgotten your password or username?" %}</a></p>
    {% endif %}
{% endblock %}
