{% extends "base.html" %}
{% load i18n %}

{% block content %}

    {% if form.errors %}
        <div class="alert alert-danger" role="alert">
            {% trans "Your username and password didn't match. Please try again." %}
        </div>

    {% endif %}


    <form role="form" class="form-horizontal" method="post" action="{% url 'login' %}">
        {% csrf_token %}
        <div class="form-group">

            <div class="form-group row">
                <label for='{{ form.username.label_tag }}' class="col-sm-2 col-form-label">{{ form.username.label }}</label>
                <div class="col-sm-10">
                    <input class="form-control" id="{{ form.username.id_for_label }}"
                           name="{{ form.username.html_name }}"/>
                </div>
                {% if form.username.errors %}
                    <div class="alert alert-danger" role="alert">
                        {{ form.username.errors }}
                    </div>
                {% endif %}
            </div>

            <div class="form-group row">
                <label for='{{ form.password.label_tag }}' class="col-sm-2 col-form-label">{{ form.password.label }}</label>
                <div class="col-sm-10">
                    <input class="form-control" id="{{ form.password.id_for_label }}"
                           name="{{ form.password.html_name }}" type="password"/>
                </div>
                {% if form.password.errors %}
                    <div class="alert alert-danger" role="alert">
                        {{ form.password.errors }}
                    </div>
                {% endif %}
            </div>

            <input type="submit" class="btn btn-primary" value="{% trans 'Login' %}"/>
            <input type="hidden" name="next" value="{{ next }}"/>
        </div>
    </form>


{% endblock %}