- $form=$this->beginWidget('bootstrap.widgets.TbActiveForm', array( 'id'=>'user-form', 'enableAjaxValidation'=>false ))

- $password_timeout_options = array(0=>Yii::t('app', 'Never'),7=>Yii::t('app', 'Every week'),14=>Yii::t('app', 'Every two weeks'),30=>Yii::t('app', 'Every month'),60=>Yii::t('app', 'Every two months'),90=>Yii::t('app', 'Every three months'),180=>Yii::t('app', 'Every six months'),365=>Yii::t('app', 'Every year'))

%p.help-block
  = Yii::t('app', 'Fields with * are required.')
  
!= $form->errorSummary($model)

- if($model->isNewRecord)
  != $form->textFieldRow($model, 'username', array('class'=>'span5','maxlength'=>256))
-else
  != $form->textFieldRow($model, 'username', array('class'=>'span5','maxlength'=>256,'readonly'=>'readonly'))
- if($model->isNewRecord || Yii::app()->user->model->canChangePassword($model->id))
  != $form->passwordFieldRow($model, 'password', array('class'=>'span5','maxlength'=>256))
  != $form->passwordFieldRow($model, 'password_repeat', array('class'=>'span5','maxlength'=>256))
- if(user()->checkAccess('manage_users'))
  != $form->radioButtonListInlineRow($model, 'can_change_password', array(0=>Yii::t('app', 'No'), 1=>Yii::t('app', 'Yes')))
  != $form->dropDownListRow($model, 'password_timeout', $password_timeout_options)
  != $form->radioButtonListInlineRow($model, 'refresh_password_at_first_login', array(0=>Yii::t('app', 'No'), 1=>Yii::t('app', 'Yes')))
!= $form->textFieldRow($model, 'email', array('class'=>'span5','maxlength'=>256))
- if($model->isNewRecord || Yii::app()->user->model->id != $model->id)
  != $form->radioButtonListInlineRow($model, 'status', array('inactive'=>Yii::t('app', 'Inactive'), 'active'=>Yii::t('app', 'Active')))
!= $form->textFieldRow($model, 'first_name', array('class'=>'span5','maxlength'=>255))
!= $form->textFieldRow($model, 'last_name', array('class'=>'span5','maxlength'=>255))
!= $form->textFieldRow($model, 'matriculation_number', array('class'=>'span5','maxlength'=>255))
!= $form->textFieldRow($model, 'qualification', array('class'=>'span5','maxlength'=>255))
- if(user()->checkAccess('manage_superuser'))
  != $form->checkBoxRow($model, 'superuser')
- if(user()->checkAccess('manage_api'))
  != $form->textFieldRow($model, 'apikey', array('id'=>'apikeyid', 'class'=>'span5','maxlength'=>255))
- if(isset($assignable_roles) && count($assignable_roles) > 0)
  != $form->dropDownListRow($model, 'role', $assignable_roles)
  
  
.form-actions
  - $this->widget('bootstrap.widgets.TbButton', array( |
    'buttonType'=>'submit',                            |
    'label'=>$model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Save'),  |
  ))                                                   |

- $this->endWidget()
