{% extends "registration/base.html" %}{% load i18n %}
{% block registration_content %}
<div class="row"><div class="col-md-6">
    <H2>{% trans "Login" %}</H2>
    {% if form.errors %}
        <h3 class="warning">{% trans "Login has failed" %}</h3>
    {% else %}
        <p />
    {% endif %}

    <form action="{% url 'login' %}" method="post">
        {% csrf_token %}

        {% if form.non_field_errors %}
        {{form.non_field_errors}}
        {% endif %}

        {% if form.email %}
          {% include "balafon/_field_form.html" with field=form.email %}
        {% else %}
           {% include "balafon/_field_form.html" with field=form.username %}
        {% endif %}

        {% include "balafon/_field_form.html" with field=form.password %}

        <div class="row" style="margin-top: 20px;">
          <div class="col-md-9">
            <a class="" href="{% url 'password_reset' %}">
                {% trans "Forgotten Password" %}
            </a>
          </div>

          <div class="col-md-3">
            <input class="btn btn-primary" type="submit" value="{% trans 'Login' %}" />
          </div>
        </div>
    </form>
</div></div>
{% endblock %}
    
