<?php
/* @var $this AlbumController */
/* @var $model Album */
/* @var $form CActiveForm */
?>

<div class="col-xs-12">

    <?php
    $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
        'id' => 'album-form',
        // Please note: When you enable ajax validation, make sure the corresponding
        // controller action is handling ajax validation correctly.
        // There is a call to performAjaxValidation() commented in generated controller code.
        // See class documentation of CActiveForm for details on this.
        'enableAjaxValidation' => false,
        'htmlOptions' => array('enctype' => 'multipart/form-data'),
    ));
    ?>

    <p class="note">Fields with <span class="required">*</span> are required.</p>

    <?php echo $form->errorSummary($model); ?>

    <?php echo $form->textFieldControlGroup($model, 'title', array('maxlength' => 200)); ?>

    <?php echo $form->textFieldControlGroup($model, 'slug', array('size' => 60, 'maxlength' => 100, 'help' => 'if empty it will be automatically generated.')); ?>

    <?php echo $form->fileFieldControlGroup($model, 'image', array('maxlength' => 45)); ?>

    <div class="form-group">
        <?php echo $form->labelEx($model, 'categories', array('class' => 'col-md-3 control-label required')); ?>
        <div class="col-md-5 controls">
            <?php
            $this->widget('ext.chosen.Chosen', array(
                'model' => $model,
                'attribute' => 'categories',
                'multiple' => true,
                'placeholderMultiple' => ' ',
                'htmlOptions' => array(
                    'class' => 'form-control tag-input-style',
                ),
                'data' => Category::model()->getTabList(),
            ));
            ?>
        </div>
    </div>


    <?php
    echo TbHtml::formActions(array(
        TbHtml::submitButton($model->isNewRecord ? Yii::t('admin', 'Create') : Yii::t('admin', 'Save'), array('color' => TbHtml::BUTTON_COLOR_PRIMARY)),
        TbHtml::resetButton(Yii::t('admin', 'Reset')),
    ));
    ?>    
    <?php $this->endWidget(); ?>

</div>