{% extends 'layouts/fullscreen.twig' %}


{% block sidebar %}
    {% include 'members/login/sidebar_login_form.twig' %}
{% endblock %}

{% block content %}

<div class="pageWrap">

    <div class="contentPageWrap membersWrap publicMembersArea">

        <div class="resetPasswordWrap">


            {% include 'includes/partials/fullscreen_page_heading.twig' with {
                title: 'Reset password',
                content: 'Please enter your new password below.'
            }%}

            {% if errors is not empty %}
                <div class="error">
                    <ul>
                        {% for error in errors %}
                            <li>{{ error }}</li>
                        {% endfor %}
                    </ul>
                </div>
            {% endif %}

            {% if success is not empty %}
                <p class="success">
                    We have succesfully updated your password.
                </p>
                <p>
                    <a href="/members/">
                        Please click here to continue to the Member's Area.
                    </a>
                </p>
            {% else %}
                <form action="{{ route('members-reset-password-action', [], false) }}"
                      method="post"
                      class="resetPassword js_resetPassword"
                >

                    <fieldset class="registerYourAddress">

                        <div class="row{% if errors.password %} inputError showError{% endif %}">
                            <label for="password">New Password</label>
                            <div class="inputWrap">
                                <input class="text" type="password" name="password" value="{{ request.password }}" />
                            </div>
                            {% if errors.password %}
                                <div class="validationMessage">
                                    {{ errors.password }}
                                </div> <!-- .validationMessage -->
                            {% endif %}
                        </div>

                        <div class="row{% if errors.password2 %} inputError showError{% endif %}">
                            <label for="password2">Confirm Password</label>
                            <div class="inputWrap">
                                <input class="text" type="password" name="password2" value="{{ request.password2 }}" />
                            </div>
                            {% if errors.password2 %}
                                <div class="validationMessage">
                                    {{ errors.password2 }}
                                </div> <!-- .validationMessage -->
                            {% endif %}
                        </div>

                        <input type="hidden" name="action" value="resetpass" />
                        <input type="hidden" name="code" value="{{ request.code }}" />
                        <input type="hidden" name="email" value="{{ request.email }}" />

                    </fieldset>

                    <div class="fullscreenFormFooter">
                        <a href="/" class="formLink">Return to homepage</a>
                        <button type="submit" class="button">Save password</button>
                    </div> <!-- .resetSubmit -->
                </form>
            {% endif %}

        </div> <!-- .resetPasswordWrap -->

    </div> <!-- .contentPageWrap.membersWrap -->

</div> <!-- .pageWrap -->

{% endblock %}
