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

{% block bodyclass %}{{ block.super }} password-reset auth{% endblock %}

{% block title %}{% translate "Password reset" %}{% endblock %}

{% block initial-content %}

  <form action="" method="post" class="w-100 m-auto" novalidate>
    {% csrf_token %}

    <h1 class="h3 mb-3 fw-normal">{% translate "Password reset" %}</h1>
    <p class="alert alert-info">{% translate "Forgotten your password? Enter your email address below, and we'll email instructions for setting a new one." %}</p>

    <div class="form-floating">
      {% translate 'Email address' as email_label %}
      <input type="text"
             placeholder="{{ email_label }}"
             class="form-control {% if form.email.errors %}is-invalid{% endif %}"
             name="{{ form.email.html_name }}"
             id="{{ form.email.html_name }}"
             value="{% firstof form.email.value "" %}"
             required>
      <label for="{{ form.email.html_name }}">{{ email_label }}</label>
      {{ form.email.errors }}
    </div>

    <button class="w-100 btn btn-lg btn-primary mt-3" type="submit">{% translate 'Reset my password' %}</button>
  </form>

  {% url 'admin:index' as admin_url %}
  {% if admin_url %}
    <br/>
    <p>
      <a class="link-body-emphasis" href="{{ admin_url }}">
        {% trans 'Go back to the login page.' %}
      </a>
    </p>
  {% endif %}
{% endblock %}
