{% extends "admin/base_site.html" %}
{% load i18n static %}
{% block extrastyle %}{{ block.super }}
    <link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}"/>{% endblock %}
{% block breadcrumbs %}
    <div class="breadcrumbs">
        <a href="{% url 'admin:index' %}"><i class="fa fa-home"></i> {% trans 'Home' %}</a>
        &rsaquo; {% trans 'Password change' %}
    </div>
{% endblock %}

{% block title %}{{ title }}{% endblock %}

{% block content %}
    <div id="content-main">
        <form method="post">
            {% csrf_token %}
            {% if form.errors %}
                <p class="errornote">
                    {% if form.errors.items|length == 1 %}
                        {% trans "Please correct the error below." %}
                    {% else %}
                        {% trans "Please correct the errors below." %}
                    {% endif %}
                </p>
            {% endif %}

            <div class="alert alert-dismissible alert-warning">
                <button class="close" type="button" data-dismiss="alert">×</button>
                <h4>{% trans "Be careful" %}!</h4>
                <p>{% trans "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>
            </div>

            <div class="tile">
                <div class="row col-md-12 mb-4">
                    <div class="col-md-12 mb-4">
                        <label>{{ form.old_password.label_tag }}</label>
                        {{ form.old_password }}
                        {{ form.old_password.errors }}
                    </div>
                    <div class="col-md-12">
                        <label>{{ form.new_password1.label_tag }}</label>
                        {{ form.new_password1 }}
                        {{ form.new_password1.errors }}
                        {% if form.new_password1.help_text %}
                            <div class="help">{{ form.new_password1.help_text|safe }}</div>
                        {% endif %}
                    </div>
                    <div class="col-md-12">
                        <label>{{ form.new_password2.label_tag }}</label>
                        {{ form.new_password2 }}
                        {{ form.new_password2.errors }}
                        {% if form.new_password2.help_text %}
                            <div class="help">{{ form.new_password2.help_text|safe }}</div>
                        {% endif %}
                    </div>
                </div>
                <div class="row col-md-12 mb-10">
                    <div class="col-md-12">
                        <button class="btn btn-primary" type="submit">
                            <i class="fa fa-fw fa-lg fa-check-circle"></i>
                            {% trans 'Change password' %}
                        </button>
                    </div>
                </div>
            </div>

        </form>
    </div>

{% endblock %}
