{extends file="simple-layout.tpl"}

{* -- We do not check admin login on this page *}
{block name="check-auth"}{/block}

{block name="page-title"}{intl l='Welcome'}{/block}

{block name="main-content"}

    <div class="col-md-offset-3 col-md-6">
        {hook name="index.top" location="index_top" }

        {form name="thelia.admin.login"}
        <form action="{url path='/admin/checklogin'}" method="post" {form_enctype}>

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

            <fieldset>
                {form_hidden_fields}

                {form_field field='success_url'}
                <input type="hidden" name="{$name}" value="{url path='/admin'}" /> {* on success, redirect to /admin *}
                {/form_field}

                {form_field field='username'}
                <div class="form-group {if $error}has-error{/if}">
                    <label for="{$label_attr.for}" class="control-label hidden">{$label} : </label>
                    <div class="input-group">
                        <span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
                        <input type="text" id="{$label_attr.for}" name="{$name}" class="form-control input-lg" title="{$label}" placeholder="{intl l='Username or e-mail address'}" autofocus>
                    </div>
                </div>
                {/form_field}

                {form_field field='password'}
                <div class="form-group {if $error}has-error{/if}">
                    <label for="{$label_attr.for}" class="control-label hidden">{$label} : </label>
                    <div class="input-group">
                        <span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>
                        <input type="password" id="{$label_attr.for}" name="{$name}" class="form-control input-lg" title="{$label}" placeholder="{intl l='Password'}">
                    </div>
                </div>
                {/form_field}

                <div class="row">
                    <div class="col-xs-6">
                        {form_field field='remember_me'}
                        <div class="form-group">
                            <div class="checkbox">
                                <label for="{$label_attr.for}">
                                    <input type="checkbox" name="{$name}" id="{$label_attr.for}" value="{$value}" {$attr} {if $options.checked}checked="checked"{/if}/> {$label}
                                </label>
                            </div>
                        </div>
                        {/form_field}
                    </div>
                    {if {config key='enable_lost_admin_password_recovery'}}
                    <div class="col-xs-6">
                        <div class="form-group text-right">
                            <div class="text-right">
                                <a class="form-control-static" href="{url path='/admin/lost-password'}">{intl l='Forgot your password ?'}</a>
                            </div>
                        </div>
                    </div>
                    {/if}
                </div>

                <div class="btn-group btn-group-justified">
                    <div class="btn-group">
                        <a href="{navigate to='index'}" class="btn btn-default btn-lg"><span class="hidden-xs glyphicon glyphicon-eye-open"></span> {intl l='View shop'}</a>
                    </div>
                    <div class="btn-group or">
                        <span>{intl l="or"}</span>
                    </div>
                    <div class="btn-group">
                        <button type="submit" class="btn btn-primary btn-lg"><span class="hidden-xs glyphicon glyphicon-off"></span> {intl l='Login'}</button>
                    </div>
                </div>
            </fieldset>
        </form>
        {/form}

        {hook name="index.middle" location="index_middle" }
    </div>

    {hook name="index.bottom" location="index_bottom" }
{/block}