<div class="col-xs-12">
    <?php
    $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
        'id' => 'user-form',
        'enableAjaxValidation' => true,
        'htmlOptions' => array('enctype' => 'multipart/form-data'),
    ));
    ?>
    <p class="note"><?php echo UserModule::t('Fields with <span class="required">*</span> are required.'); ?></p>
    <?php //echo $form->errorSummary(array($model, $profile)); ?>
    <?php echo $form->textFieldControlGroup($model, 'username', array( 'maxlength' => 20)); ?>
    <?php echo $form->passwordFieldControlGroup($model, 'password', array( 'maxlength' => 128)); ?>
    <?php echo $form->textFieldControlGroup($model, 'email', array( 'maxlength' => 128)); ?>
    <?php echo $form->dropDownListControlGroup($model, 'superuser', User::itemAlias('AdminStatus')); ?>
    <?php echo $form->dropDownListControlGroup($model, 'status', User::itemAlias('UserStatus')); ?>
    <?php
    // $profileFields = $profile->getFields();
    /*if ($profileFields) {
        foreach ($profileFields as $field) {
            ?>
            <?php
            if ($widgetEdit = $field->widgetEdit($profile)) {
                echo $widgetEdit;
            } elseif ($field->range) {
                echo $form->dropDownListControlGroup($profile, $field->varname, Profile::range($field->range));
            } elseif ($field->field_type == "TEXT") {
                echo TbHtml::activeTextAreaControlGroup($profile, $field->varname, array('rows' => 6, 'cols' => 50));
            } else {
                echo $form->textFieldControlGroup($profile, $field->varname, array( 'maxlength' => (($field->field_size) ? $field->field_size : 255)));
            }
            ?>
            <?php echo $form->error($profile, $field->varname); ?>
            <?php
        }
    }*/
    ?>

    <?php
    echo TbHtml::formActions(array(
        CHtml::submitButton($model->isNewRecord ? Yii::t('admin', 'Create') : Yii::t('admin', 'Save'), array('class' => 'btn btn-primary'))
    ));
    ?>

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