{% extends "admin/base_site.html" %}
{% load i18n static %}

{% block container %}

<div class="auth-wrapper">
    <div class="auth-content">
        <div class="auth-bg">
            <span class="r"></span>
            <span class="r s"></span>
            <span class="r s"></span>
            <span class="r"></span>
        </div>
        <div class="card">
          <form action="{{ app_path }}" method="post" id="login-form">
            {% csrf_token %}
            <div class="card-body text-center">
                <div class="mb-4">
                    <i class="feather icon-unlock auth-icon"></i>
                </div>
                <h3 class="mb-4">Login</h3>
                <div class="input-group">
                  {% if form.errors and not form.non_field_errors %}
                    <p class="text-danger">
                    {% if form.errors.items|length == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %}
                    </p>
                  {% endif %}
                  {% if form.non_field_errors %}
                    {% for error in form.non_field_errors %}
                    <p class="text-danger">
                        {{ error }}
                    </p>
                    {% endfor %}
                  {% endif %}

                  {% if user.is_authenticated %}
                    <p class="text-danger">
                    {% blocktrans trimmed %}
                        You are authenticated as {{ username }}, but are not authorized to
                        access this page. Would you like to login to a different account?
                    {% endblocktrans %}
                    </p>
                  {% endif %}
                </div>
                <div class="input-group">
                  {{ form.username.label_tag }}
                </div>
                <div class="input-group mb-3">
                  {{ form.username.errors }}
                  {{ form.username }}
                </div>
                <div class="input-group">
                  {{ form.password.label_tag }}
                </div>
                <div class="input-group mb-4">
                  {{ form.password.errors }}
                  {{ form.password }}
                </div>
                <input type="hidden" name="next" value="{{ next }}">
                <button class="btn btn-primary shadow-2 mb-4">{% trans 'Log in' %}</button>
                {% url 'admin_password_reset' as password_reset_url %}
                {% if password_reset_url %}
                <p class="mb-2 text-muted">{% trans 'Forgotten your password or username?' %}<a href="{{ password_reset_url }}">{% trans "Reset" %}</a></p>
                {% endif %}
            </div>
          </form>
        </div>
    </div>
</div>
{% endblock container %}




