{% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %}

{% import "macro_functions.phtml" as mf %}

{% block meta_title %}{% trans 'Reset password' %}{% endblock %}

{% block content %}

    <div class="h-block">
        <div class="h-block-header">
            <div class="icon"><span class="icon-mail"></span></div>
            <h2>{% trans 'How to reset my password?' %}</h2>
            <p>{% trans 'Enter your email to reset password. You will receive new password after reset link is confirmed.' %}</p>
        </div>
        <div class="block">
            <form action="" method="post" id="password-reset">
                <fieldset>
                    <legend>{% trans 'Reset password' %}</legend>
                    <label>{% trans 'Email Address' %}: </label>
                    <input type="email" name="email" value="{{ request.email }}" required="required">
                    <input class="bb-button bb-button-submit" type="submit" value="{% trans 'Reset password' %}">
                </fieldset>
            </form>
        </div>
    </div>

{% endblock %}

{% block js %}
<script type="text/javascript">
$(function() {
    $('#password-reset').bind('submit',function(event){
        bb.post(
            'guest/client/reset_password',
            $(this).serialize(),
            function(result) {
                bb.msg('{% trans "Password reset confirmation email was sent" %}');
            }
        );
        return false;
    });
});
</script>
{% endblock %}