{% extends "admin/base.html" %}
{% load i18n static palette palette_admin %}


{% block body %}

<div class="d-flex justify-content-center align-items-center position-fixed h-100 w-100">
  <div class="col-sm-6 col-lg-5">
    <div class="card shadow-sm">
      {% if validlink %}

      <div class="card-body">
        <div class="d-flex gap-2 align-items-center">
          <i class="bi bi-shield-shaded h2"></i>
          <h4 class="d-flex"> {% trans "Set new password" %}</h4> 
        </div>

        <hr />

        <p class="alert small alert-info mx-0">{% translate "Please enter your new password twice so we can verify you typed it in correctly." %}</p>
        <form method="post">{% csrf_token %}
          <fieldset class="">
            <input class="d-none hidden" autocomplete="username" value="{{ form.user.get_username }}">
            <div class="form-group mb-2 field-password1">
              {{ form.new_password1.errors }}
              <div class="flex-container">
                <label class="form-label" for="id_new_password1">{% translate 'New password:' %}</label>
                <input class="form-control" type="password" name="{{ form.new_password1.html_name }}" id="{{ form.new_password1.id_for_label }}" />
              </div>
            </div>
            <div class="form-group field-password2">
              {{ form.new_password2.errors }}
              <div class="flex-container">
                <label class="form-label" for="id_new_password2">{% translate 'Confirm password:' %}</label>
                <input class="form-control" type="password" name="{{ form.new_password2.html_name }}" id="{{ form.new_password2.id_for_label }}" />
              </div>
            </div>
          </fieldset>
          <div class="form-group mt-3">
            <input type="submit" class="btn w-100 btn-dark" value="{% translate 'Change my password' %}">
          </div>
        </form>
      </div>
      {% else %}

      <p>{% translate "The password reset link was invalid, possibly because it has already been used.  Please request a new password reset." %}</p>

      {% endif %}
    </div>
  </div>
</div>
{% endblock %}
