{% extends "layout_public.phtml" %}

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

{% block body %}

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

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

    </div>
</div>

<ul class="login-footer">
    <li><a href="{{ 'signup'|link }}"><small>{{ 'Signup'|trans }}</small></a></li>
    <li><a href="{{ 'login'|link }}"><small>{{ 'Login'|trans }}</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("{{ 'Password reset confirmation email was sent'|trans }}");
            }
        );

        return false;
    });
});
</script>
{% endblock %}