<?php
/* @var $this SiteController */
/* @var $model FormularioLoginUsuario */
/* @var $form TbActiveForm  */

$this->layout = '//layouts/login';
$this->pageTitle = Yii::app()->name . ' - ' . Yii::t('factuges', 'Inicar sesión');
if (isset($this->title))
    $this->title = Yii::t('factuges', 'Inicar sesión');
$this->breadcrumbs = array(Yii::t('factuges', 'Inicar sesión'));
?>

<!-- BEGIN LOGIN FORM -->
<?php
    /*$form = $this->beginWidget('CActiveForm', array(
        'id' => 'formulario-login-usuario',
        'enableAjaxValidation' => true,
        //'disableAjaxValidationAttributes' => array('RegistrationForm_verifyCode'),
        'htmlOptions' => array('enctype' => 'multipart/form-data'),
    ));*/

$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
    'id' => 'login-form',
    'type' => 'vertical',
    'clientOptions' => array(
        'validateOnSubmit' => true,
    )
    ));
?>
    <h3 class="form-title"><?php echo Yii::t('factuges', 'Iniciar sesión'); ?></h3>
    <?php if ($model->hasErrors()) { ?>
        <div class="alert alert-error">
            <button class="close" data-dismiss="alert"></button>
            <span><?php echo CHtml::errorSummary($model, '', '', array('firstError' => true)); ?></span>
        </div>
    <?php } ?>
    
    <div class="control-group">
        <!--ie8, ie9 does not support html5 placeholder, so we just show field title for that-->
        <label class="control-label visible-ie8 visible-ie9"><?php echo $form->labelEx($model, 'username'); ?></label>
        <div class="controls">
            <div class="input-icon left">
                <i class="icon-user"></i>
                <?php
                echo $form->textField($model, 'username', array(
                    'class' => 'm-wrap placeholder-no-fix',
                    'placeholder' => $model->getAttributeLabel('username'),
                ));
                ?>
            </div>
            <label for="username" class="help-inline help-small no-left-padding">Username is required.</label>

        </div>
    </div>
    <div class="control-group">
        <label class="control-label visible-ie8 visible-ie9"><?php echo $form->labelEx($model, 'password'); ?></label>
        <div class="controls">
            <div class="input-icon left">
                <i class="icon-lock"></i>
                <?php
                echo $form->passwordField($model, 'password', array(
                    'class' => 'm-wrap placeholder-no-fix',
                    'placeholder' => $model->getAttributeLabel('password'),
                ));
                ?>
            </div>
        </div>
    </div>
    <div class="form-actions">
        <?php echo $form->checkBoxRow($model, 'recuerdame'); ?>        
        <?php
        $this->widget('bootstrap.widgets.TbButton', array(
            'buttonType' => 'submit',
            'type' => 'primary',
            'encodeLabel' => false,
            'label' => Yii::t('factuges', 'Entrar') . ' ' . CHtml::tag('i', array('class' => 'm-icon-swapright m-icon-white'), ''),
            'htmlOptions' => array('class' => 'btn green pull-right'),
        ));
        ?>
    </div>
    <div class="forget-password">
        <h4><?php echo Yii::t('factuges', '¿Has olvidado tu contraseña?'); ?></h4>
        <p>
            <?php echo Yii::t('factuges', 'Haz'); ?> <?php echo CHtml::link(Yii::t('factuges', 'click aquí'), Yii::app()->getModule('usuario')->urlRecuperar); ?>            
            <?php echo Yii::t('factuges', 'para restablecer tu contraseña.'); ?>.
        </p>
    </div>
    <div class="create-account">
        <p>
            <?php echo Yii::t('factuges', '¿Es la primera vez que utilizas FactuGES?'); ?>
            <?php echo CHtml::link(Yii::t('factuges', 'Crear una cuenta'), Yii::app()->createAbsoluteUrl(Yii::app()->getModule('usuario')->urlRegistro)); ?>
        </p>
    </div>
<?php $this->endWidget(); ?>
<!-- END LOGIN FORM --> 
