{% extends 'accounts/base.html' %}
{% load static %}
{% block head_title %}| Nueva Contraseña{% endblock %}
{% block content %}
{% if request.user.is_authenticated %}
    <script>
        window.location.href = "{% url 'linkzone:console' %}"
    </script>
{% endif %}
<div class="container">
    <div class="row">
        <div class="col-12 col-lg-7 mx-auto register-view">
            <div class="main-logo mt-5">
                <img src="{% static 'img/oficial.png' %}">
            </div>
            <div class="instant-messages">
                {% if messages %}
                    {% for message in messages %}
                        <div class="alert alert-{{ message.tags }} alert-dismissible fade show" role="alert">
                            <span class="alert-inner--icon"><i class="ni ni-like-2"></i></span>
                            <span class="alert-inner--text">{{ message }}</span>
                            <button type="button" class="close" data-dismiss="alert" aria-label="close">
                                <span aria-hidden="true">&times;</span>
                            </button>
                        </div>
                    {% endfor %}
                {% endif %}
            </div>
            <form class="login-form p-4 rounded col-lg-10 mx-auto" method="post">
                {% csrf_token %}
                <h3 class="mb-2 text-center font-weight-bold oxanium">Nueva contraseña</h3>
                {% if form.errors %}
                <div class="alert alert-danger" role="alert">
                    Error: contraseña invalida
                </div>
                {% endif %}
        
                <label class="small font-weight-bold">{{ form.new_password1.label }}</label>
                {{ form.new_password1 }}
                <label class="small font-weight-bold">{{ form.new_password2.label }}</label>
                {{ form.new_password2 }}
                <ul>
                    <li>Su contraseña no puede ser alusiva a información personal</li>
                    <li>Debe contener al menos 8 caracteres(alfanumericos y especiales)</li>
                    <li>No puede ser igual a las anteriores</li>
                </ul>
                <button class="btn link-zone btn-block py-2 mb-4 mt-5 fw" type="submit" value="Change">Ingresar</button>
            </form>
            <p class="small text-center">
                <a href="{% url 'accounts:login' %}">¿Ya tienes una cuenta?</a>
            </p>
            <p class="small text-center">
                <a href="#">Soporte</a>
            </p>
        </div>
    </div>
</div>
{% endblock  %}