<div class="form">

    <?php
    /**
     * @var BHorizontalForm $form
     * @var Review $model
     * @var ReviewI18n[] $i18nModels
     */
    ?>

    <?php $form = $this->beginWidget('BHorizontalForm', array(
    'id' => 'review-form',
    '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); ?>

    -->

    <div class="control-group <?php echo ($model->hasErrors('dateRu') ? ' error' : '') ?>">
        <?php echo $form->label($model, 'dateRu', array('class' => 'control-label'))?>
        <div class="controls">
            <?php
            $this->widget('zii.widgets.jui.CJuiDatePicker', array(
                'model' => $model,
                'attribute' => 'dateRu',
                'language' => 'ru',
                'options' => array(
                    'showAnim' => 'fold',
                ),
                'htmlOptions' => array(
                    'style' => 'height:20px;'
                ),
            ));
            ?>
            <?php echo $form->error($model, 'dateRu'); ?>
        </div>
    </div>


    <?php
    echo $form->controlGroup($model, 'image',
        $form->fileField($model, 'image') . '<br/>' .
            CHtml::image($model->imageBehavior->getFileUrl('medium')));
    ?>

    <?php
    /**
     * @var BTabs $tabs
     */
    $tabs = $this->beginWidget('BTabs');
    foreach ($i18nModels as $lang => $i18nModel):
        ?>
        <?php $tabs->beginTab(Yii::app()->params['languageNames'][$lang]) ?>
        <div class="control-group <?php echo ($i18nModel->hasErrors('name') ? ' error' : '') ?>">
            <?php echo $form->label($i18nModel, 'name', array('class' => 'control-label'))?>
            <div class="controls">
                <?php echo $form->textField($i18nModel, "[$lang]name", array('size' => 60, 'maxlength' => 64)); ?>
                <?php echo $form->error($i18nModel, 'name'); ?>
            </div>
        </div>

        <div class="control-group <?php echo ($i18nModel->hasErrors('comment') ? ' error' : '') ?>">
            <?php echo $form->label($i18nModel, 'comment', array('class' => 'control-label'))?>
            <div class="controls">
                <?php echo $form->textArea($i18nModel, "[$lang]comment", array('rows' => 6, 'cols' => 50)); ?>
                <?php echo $form->error($i18nModel, 'comment'); ?>
            </div>
        </div>

        <div class="control-group <?php echo ($i18nModel->hasErrors('link_text') ? ' error' : '') ?>">
            <?php echo $form->label($i18nModel, 'link_text', array('class' => 'control-label'))?>
            <div class="controls">
                <?php echo $form->textField($i18nModel, "[$lang]link_text", array('size' => 60, 'maxlength' => 128)); ?>
                <?php echo $form->error($i18nModel, 'link_text'); ?>
            </div>
        </div>

        <div class="control-group <?php echo ($i18nModel->hasErrors('link_url') ? ' error' : '') ?>">
            <?php echo $form->label($i18nModel, 'link_url', array('class' => 'control-label'))?>
            <div class="controls">
                <?php echo $form->textField($i18nModel, "[$lang]link_url", array('size' => 60, 'maxlength' => 128)); ?>
                <?php echo $form->error($i18nModel, 'link_url'); ?>
            </div>
        </div>

        <?php $tabs->endTab() ?>
        <?php
    endforeach;
    $this->endWidget();
    ?>

    <div class="form-actions">
        <button type="submit" class="btn btn-large btn-primary">
            <?php echo ($model->isNewRecord ? 'Создать' : 'Сохранить'); ?>
        </button>
    </div>

    <?php $this->endWidget(); ?>

</div><!-- form -->
