{% extends "layout_public.phtml" %}

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

{% block body %}

<section class="container login" role="main">

 <h1>{% trans 'Reset password' %}</h1>

<div class="data-block">
    <div class="data-container">

        <form method="post" action="" id="password-reset">
            <fieldset>
                <div class="control-group">
                    <label class="control-label" for="email">{% trans 'Email Address' %}</label>
                    <div class="controls">
                        <input id="icon" type="text" placeholder="{% trans 'Your email address' %}" name="email" value="{{ request.email }}" required="required" data-validation-required-message="{% trans 'You must fill in your email.' %}">
                        <div class="help-block"></div>
                        <span class="help-block">{% trans 'Enter your email to reset password. You will receive new password after reset link is confirmed.' %}</span>
                    </div>
                </div>
                <div class="form-actions">
                    <button class="btn btn-block btn-large btn-inverse btn-alt span3" type="submit">{% trans 'Reset password' %}</button>
                </div>
            </fieldset>
        </form>

    </div>
</div>

<ul class="login-footer">
    <li><a href="{{ 'signup'|link }}"><small>{% trans 'Signup' %}</small></a></li>
    <li><a href="{{ 'login'|link }}"><small>{% trans 'Login' %}</small></a></li>
</ul>

</section>
{% 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 %}