{% extends "adminlte_full/skeleton_login.html" %}
{% import "adminlte_full/macros/bootstrap4.html" as bootstrap %}

{% block page_title %}{{ adminlte.gettext('Recover Password') }}{% endblock %}

{% block messages %}
  <p class="login-box-msg">
    {% if validlink %}
      {{ adminlte.gettext('Please enter your new password twice so we can verify you typed it in correctly.') }}
    {% else %}
      {{ adminlte.gettext('The password reset link was invalid, possibly because it has already been used. Please request a new password reset.') }}
    {% endif %}
  </p>
{% endblock messages %}

{% block page_content %}
  {% if validlink %}
    {% block form %}
      <form method="post" role="form">
        {% block form_fields %}
          {{ bootstrap.form_fields(form, form_group_class='input-group mb-3', show_label=false, placeholder=true) }}
        {% endblock form_fields %}
        <div class="row">
          <div class="col-12">
            <button type="submit" class="btn btn-primary btn-block">{{ adminlte.gettext('Change my password') }}</button>
          </div>
        </div>
      </form>
    {% endblock form %}
  {% else %}
    <a class="btn btn-primary btn-block" href="{{ adminlte.create_url(config.ADMINLTE_PASSWORD_RESET_ENDPOINT) }}">
        {{ adminlte.gettext('Reset my password') }}
    </a>
  {% endif %}
{% endblock page_content %}

{% block custom_links %}
  <p class="mt-3 mb-0">
    <a href="{{ adminlte.create_url(config.ADMINLTE_LOGIN_ENDPOINT) }}">{{ adminlte.gettext('Log in') }}</a>
  </p>
{% endblock %}