{% extends "admin/login.html" %}
{% load i18n %}
{% block content %}
{% if form.errors and not form.non_field_errors %}
<p class="errornote">
{% if form.errors.items|length == 1 %}Please correct the error below{% else %}Please correct the errors below{% endif %}
</p>
{% endif %}

{% if form.non_field_errors %}
{% for error in form.non_field_errors %}
<p class="errornote">
    {{ error }}
</p>
{% endfor %}
{% endif %}

<div id="content-main">

{% if user.is_authenticated %}
<p class="errornote">
{% block trimmed %}
    You are authenticated as {{ username }}, but are not authorized to
    access this page. Would you like to login to a different account?
{% endblock %}
</p>
{% endif %}

<form action="{{ app_path }}" method="post" id="login-form">{% csrf_token %}
  <div class="form-row">
    {{ form.username.errors }}
    <label class="required" for="id_username">
      {% trans 'Email, phone number or username' %}:
    </label>
    {{ form.username }}
  </div>
  <div class="form-row">
    {{ form.password.errors }}
    {{ form.password.label_tag }} {{ form.password }}
    <input type="hidden" name="next" value="{{ next }}" />
  </div>
  <div class="form-row">
    <a href="{% url 'account_reset_password' %}">Forgot Password?</a>
  </div>
  <div class="submit-row">
    <input type="submit" value="Log in" />
  </div>
</form>

</div>
{% endblock %}
