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

{% block extrahead %}{{ block.super }}
<script src="{% url 'admin:jsi18n' %}"></script>
{% endblock %}
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" href="{% static "admin/css/forms.css" %}" />{% endblock %}
{% block bodyclass %}{{ block.super }} {{ opts.app_label }}-{{ opts.model_name }} change-form{% endblock %}
{% if not is_popup %}
{% endif %}
{% block content %}<div id="content-main">
<form action="{{ form_url }}" method="post" id="{{ opts.model_name }}_form">{% csrf_token %}{% block form_top %}{% endblock %}
<div>
{% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %}
<p>{% blocktrans with username=original %}Enter a new password for the user <strong>{{ username }}</strong>.{% endblocktrans %}</p>

{% if form.password1.help_text %}
<p class="help">{% autoescape off %}{{ form.password1.help_text }}{% endautoescape %}</p>
{% endif %}

{% if form.password2.errors %}
<div class="alert alert-danger" style="max-width: 500px">
    <p class="errornote">
    {% if form.password2.errors.items|length == 1 %}{% trans "Please correct the error below." %}{% else %}
    {% trans "Please correct the errors below." %}{% endif %}
    </p>
    {{ form.password2.errors }}
</div>
{% endif %}

<div class="row mb-3">
  <div class="col text-end" style="max-width: 200px">{{ form.password1.label_tag }}</div>
  <div class="col-auto">{{ form.password1 }}</div>
</div>

<div class="row mb-3">
  <div class="col text-end" style="max-width: 200px">{{ form.password2.label_tag }}</div>
  <div class="col-auto">{{ form.password2 }}</div>
</div>

<div class="row mb-3">
  <div class="col">
    <input class="btn btn-primary" type="submit" value="{% trans 'Change password'|capfirst %}" />
  </div>
</div>

<script>document.getElementById("id_password1").focus();</script>
</div>
</form></div>
{% endblock %}
