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

{% block userlinks %}
  {% url 'django-admindocs-docroot' as docsroot %}{% if docsroot %}<a href="{{ docsroot }}">{% translate 'Documentation' %}</a> / {% endif %} {% translate 'Change password' %} /
  <form id="logout-form" method="post" action="{% url 'admin:logout' %}">
    {% csrf_token %}
    <button type="submit">{% translate 'Log out' %}</button>
  </form>
{% endblock %}
{% block breadcrumbs %}
  <nav class="breadcrumb">
    <ul>
      <li><a href="{% url 'admin:index' %}">{% translate 'Home' %}</a></li>
      <li class="is-active"><a href="#" aria-current="page">{% translate 'Password change' %}</a></li>
    </ul>
  </nav>
{% endblock %}

{% block content %}<div id="content-main" style="max-width:480px;">

  <form method="post">{% csrf_token %}
    <div>
      {% if form.errors %}
	<p class="errornote notification is-danger is-light">
	  {% if form.errors.items|length == 1 %}{% translate "Please correct the error below." %}{% else %}{% translate "Please correct the errors below." %}{% endif %}
	</p>
      {% endif %}


      <p class="block">{% translate 'Please enter your old password, for security’s sake, and then enter your new password twice so we can verify you typed it in correctly.' %}</p>

      <fieldset class="module aligned wide">

	<div class="field">
	  {{ form.old_password.errors }}
	  {{ form.old_password.label_tag }} {{ form.old_password }}
	</div>

	<div class="field">
	  {{ form.new_password1.errors }}
	  {{ form.new_password1.label_tag }} {{ form.new_password1 }}
	  {% if form.new_password1.help_text %}
	    <div class="help"{% if form.new_password1.id_for_label %} id="{{ form.new_password1.id_for_label }}_helptext"{% endif %}>{{ form.new_password1.help_text|safe }}</div>
	  {% endif %}
	</div>

	<div class="field">
	  {{ form.new_password2.errors }}
	  {{ form.new_password2.label_tag }} {{ form.new_password2 }}
	  {% if form.new_password2.help_text %}
	    <div class="help"{% if form.new_password2.id_for_label %} id="{{ form.new_password2.id_for_label }}_helptext"{% endif %}>{{ form.new_password2.help_text|safe }}</div>
	  {% endif %}
	</div>

      </fieldset>

      <div class="field mt-5">
	<input type="submit" value="{% translate 'Change my password' %}" class="button is-primary">
      </div>

    </div>
  </form></div>

{% endblock %}
