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

{% block extrahead %}
    {{ block.super }}
    <script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>
    {{ media.css }}
{% endblock %}

{% block extrastyle %}
    {{ block.super }}
    <link href="{% static 'admin/css/admin.form.css' %}" rel="stylesheet" type="text/css" />
{% endblock %}

{% block bodyclass %}
    {{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} change-form
{% endblock %}

{% block breadcrumbs %}
    <div class="kt-subheader__breadcrumbs" id="breadcrumbs">
        <a href="{% url 'admin:index' %}" class="kt-subheader__breadcrumbs-link">
            <i class="flaticon2-shelter"></i> Início
        </a>
        <span class="kt-subheader__breadcrumbs-separator"></span>
        <span class="kt-subheader__breadcrumbs-link breadcrumb-active">
            Alterar Senha
        </span>
    </div>
{% endblock %}

{% block title %}{{ title }}{% endblock %}
{% block content_title %}<h1>{{ title }}</h1>{% endblock %}

{% block content %}
    <div id="content-main" class="kt-portlet">

        <form method="post">{% csrf_token %}
            <div class="kt-portlet__body">
                {% 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 %}


                <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>

                <fieldset class="module aligned wide ml-4 mr-3">

                    <div class="form-group row">
                        {{ form.old_password.errors }}
                        {{ form.old_password.label_tag }}
                        {{ form.old_password | addclass:"form-control"  }}
                    </div>

                    <div class="form-group row">
                        {{ form.new_password1.errors }}
                        {{ form.new_password1.label_tag }}
                        {{ form.new_password1 | addclass:"form-control" }}
                        {% if form.new_password1.help_text %}
                            <div class="help">{{ form.new_password1.help_text|safe }}</div>
                        {% endif %}
                    </div>

                    <div class="form-group row">
                        {{ form.new_password2.errors }}
                        {{ form.new_password2.label_tag }}
                        {{ form.new_password2 | addclass:"form-control" }}
                        {% if form.new_password2.help_text %}
                            <div class="help">{{ form.new_password2.help_text|safe }}</div>
                        {% endif %}
                    </div>

                </fieldset>

                <div class="submit-row kt-portlet__foot--fit">
                    <input class="btn btn-primary" type="submit" value="{% trans 'Change my password' %}" class="default">
                </div>

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

{% endblock %}
