{% extends 'accounts/base.html' %}
{% load static %}
{% block head_title %}| Restablecer 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 min-vh-100">
                <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 action="{% url 'accounts:password-reset' %}" method="post" class="account-form p-4 rounded col-lg-10 mx-auto">
                   <p class="h3 mb-4 font-weight-bold oxanium text-center">¿Olvidó su contraseña?</p>
                        <p>Ingresa tu correo electronico para recuperar la contraseña.</p>
                   {% if form.errors %}
                     <div class="alert alert-danger" role="alert">
                        Error: Esta dirección de correo no esta registrada
                    </div>
                    {% endif %} 
                    {% csrf_token %}
                    <label class="small font-weight-bold">{{ form.email.label }}</label>
                    {{ form.email }}
                    <button class="btn link-zone btn-block py-2 mb-4 mb-4 mt-5 fw-bold w-100" type="submit" value="reset password">Enviar</button>
                    <p class="text-center"><a href="{% url 'accounts:login' %}">Iniciar sesion</a></p>
                </form>
             </div>
         </div>
    </div>
{% endblock  %}