<div class="form">

    <?php
    /**
     * @var BHorizontalForm $form
     * @var SportEvent $model
     * @var SportEventI18n[] $i18nModels
     */
    ?>

    <?php $form = $this->beginWidget('BHorizontalForm', array(
    'id' => 'sport-event-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('sport_event_category_id') ? ' error' : '') ?>">
        <?php echo $form->label($model, 'sport_event_category_id', array('class' => 'control-label'))?>
        <div class="controls">
            <?php echo $form->dropDownList($model, 'sport_event_category_id', $model->getSportEventCategories()); ?>
            <?php echo $form->error($model, 'sport_event_category_id'); ?>
        </div>
    </div>

    <div class="control-group <?php echo ($model->hasErrors('country_id') ? ' error' : '') ?>">
        <?php echo $form->label($model, 'country_id', array('class' => 'control-label'))?>
        <div class="controls">
            <?php echo $form->dropDownList($model, 'country_id', $model->getCountries()); ?>
            <?php echo $form->error($model, 'country_id'); ?>
        </div>
    </div>


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

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

    <?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('description') ? ' error' : '') ?>">
            <?php echo $form->label($i18nModel, 'description', array('class' => 'control-label'))?>
            <div class="controls">
                <?php echo $form->textArea($i18nModel, "[$lang]description", array('rows' => 6, 'cols' => 50)); ?>
                <?php echo $form->error($i18nModel, 'description'); ?>
            </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 -->
