{% extends "account/pre_login_base.html" %}
{% load i18n %}
{% load static %}

{% block non_login_content %}

    <div id="loginbox">
        <div class="login">
            {% if form.non_field_errors %}
                {% for error in form.non_field_errors %}
                    <div class="alert alert-danger" role="alert">
                        {{ error }}
                    </div>
                {% endfor %}
            {% endif %}
            <h2>Login</h2>

            <form method="post" action="">
                {% csrf_token %}
                <div>
                    <label for="id_username"
                           class="visually-hidden">
                        {% trans "Email" %}
                    </label>
                    <input type="text"
                           id="id_username"
                           name="login"
                           class="form-control mb-lg-2"
                           placeholder="{% trans "Email" %}"
                           required
                           autofocus>
                </div>
                <div>
                    <label for="id_password" class="visually-hidden">
                        {% trans "Password" %}
                    </label>
                    <input type="password"
                           id="id_password"
                           name="password"
                           class="form-control mb-lg-2"
                           placeholder="{% trans "Password" %}"
                           required>
                </div>
                <div>
                    <button type="submit">{% trans "Login" %}</button>
                </div>
            </form>
            <div>
                <a href="{% url "account_reset_password" %}"
                   class="w-100 btn btn-lg btn-outline-info">
                    {% trans "Forgot password?" %}
                </a>
            </div>
        </div>
        <div class="signup">
            <img src="https://data.coop/static/img/logo_da.svg" alt="data.coop logo">
            <div class="new_here">
                <h2>{% trans "Are you new here?" %}</h2>
                <a class="button" href="{% url "account_signup" %}">{% trans "Become a member" %}</a>
            </div>
        </div>
    </div>

{% endblock %}
