{extends file="layout.tpl"}

{* Body Class *}
{block name="body-class"}page-account-password{/block}

{* Breadcrumb *}
{block name='no-return-functions' append}
    {$breadcrumbs = [['title' => {intl l="Account"}, 'url'=>{url path="/account"}]]}
    {$breadcrumbs = [
    ['title' => {intl l="Account"}, 'url'=>{url path="/account"}],
    ['title' => {intl l="Change Password"}, 'url'=>{url path="/account/password"}]
    ]}
{/block}

{block name="main-content"}

    <div class="main">

        <article class="col-main" role="main" aria-labelledby="main-label">

            <h1 id="main-label" class="page-header">{intl l="Change Password"}</h1>

            {form name="thelia.front.customer.password.update"}
            <form id="form-register" class="form-horizontal" action="{url path="/account/password"}" method="post" role="form">
                {form_field form=$form field='success_url'}
                    <input type="hidden" name="{$name}" value="{url path="/account"}" />
                {/form_field}

                {form_hidden_fields form=$form}

                {if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}

                <fieldset id="register-info" class="panel">
                    <div class="panel-heading">
                        {intl l="Login Information"}
                    </div>

                    <div class="panel-body">
                        {form_field form=$form field="password_old"}
                        <div class="form-group group-password_old {if $error}has-error{elseif $isPost && $value != "" && !$error}has-success{/if}">
                            <label class="control-label" for="{$label_attr.for}">{$label}{if $required} <span class="required">*</span>{/if}</label>
                            <div class="control-input">
                                <input type="password" name="{$name}" id="{$label_attr.for}" class="form-control" value="{$value}" {if $required} aria-required="true" required{/if}{if $error} autofocus{/if}>
                                {if $error }
                                    <span class="help-block"><i class="icon-remove"></i> {$message}</span>
                                    {assign var="error_focus" value="true"}
                                {/if}
                            </div>
                        </div><!--/.form-group-->
                        {/form_field}

                        {form_field form=$form field="password"}
                        <div class="form-group group-password {if $error}has-error{elseif $isPost && $value != "" && !$error}has-success{/if}">
                            <label class="control-label" for="{$label_attr.for}">{$label}{if $required} <span class="required">*</span>{/if}</label>
                            <div class="control-input">
                                <input type="password" name="{$name}" id="{$label_attr.for}" class="form-control" value="{$value}" {if $required} aria-required="true" required{/if}{if !isset($error_focus) && $error} autofocus{/if}>
                                {if $error }
                                    <span class="help-block"><i class="icon-remove"></i> {$message}</span>
                                    {assign var="error_focus" value="true"}
                                {/if}
                            </div>
                        </div><!--/.form-group-->
                        {/form_field}
                        {form_field form=$form field="password_confirm"}
                        <div class="form-group group-password_confirm {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
                            <label class="control-label" for="{$label_attr.for}">{$label}{if $required} <span class="required">*</span>{/if}</label>
                            <div class="control-input">
                                <input type="password" name="{$name}" id="{$label_attr.for}" class="form-control" autocomplete="off"{if $required} aria-required="true" required{/if}{if !isset($error_focus) && $error} autofocus{/if}>
                                {if $error }
                                    <span class="help-block"><i class="icon-remove"></i> {$message}</span>
                                    {assign var="error_focus" value="true"}
                                {/if}
                            </div>
                        </div><!--/.form-group-->
                        {/form_field}
                    </div>
                </fieldset>

                <div class="form-group group-btn">
                    <div class="control-btn">
                        <button type="submit" class="btn btn-register">{intl l="Change Password"}</button>
                    </div>
                </div><!--/.form-group-->
            </form>
            {/form}
        </article>

    </div><!-- /.layout -->
{/block}