{% extends "outside_template/registration/base_login.html" %}
{% load i18n static %}

{#{% block breadcrumb %}#}
{#    <div class="breadcrumbs">#}
{#        <a href="{% url 'core:index' %}">{% trans 'Home' %}</a>#}
{#        {% trans 'Password reset confirmation' %}#}
{#    </div>#}
{#{% endblock %}#}

{% block containerright %}
    {% if validlink %}
        <div class="alert alert-warning" role="alert">
            {% trans "Please enter your new password twice so we can verify you typed it in correctly." %}
        </div>

        <form class="needs-validation was-validated" method="post" novalidate>
            {% csrf_token %}
            {% for hidden in form.hidden_fields %}
                {{ hidden }}
            {% endfor %}
            {% for field in form.visible_fields %}
                <div class="form-group {{ field.html_name }}">
                    <label for="{{ field.id_for_label }}">{% trans 'Confirm password:' %}</label>
                    <input name="{{ field.html_name }}"
                           id="{{ field.id_for_label }}"
                           type="{{ field.field.widget.input_type }}"
                           {% if field.field.max_length %}maxlength="{{ field.field.max_length }}"{% endif %}
                           value="{% if field.value is not None %}{{ field.value }}{% endif %}"
                            {% if field.field.required %} required {% endif %}
                           class="form-control obrigatorio" placeholder="{{ field.label }}">

                    {% if field.field.required %}
                        <div class="invalid-feedback">
                            {{ field.field.error_messages.required|default:"Campo Obrigatorio." }}
                        </div>
                    {% endif %}
                    {% if field.errors %}
                        {{ field.errors }}
                    {% endif %}
                    {% if field.help_text %}
                        <small class="form-text text-muted">{{ field.help_text|safe }}</small>
                    {% endif %}
                </div>
            {% endfor %}
            <div class="form-group">
                <input class="btn btn-success" type="submit" value="{% trans 'Change my password' %}"/>
            </div>
        </form>
    {% else %}
        <div class="alert alert-danger p-3" role="alert">
            {% trans "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %}
        </div>
    {% endif %}

{% endblock %}
