-$canSeeBlack = user()->checkAccess('blacklist_visibility')
-$canSeeWhite = user()->checkAccess('whitelist_visibility')
-$canSeeAll = $canSeeBlack && $canSeeWhite
-$canSee = $canSeeBlack || $canSeeWhite
-if(!$canSee)
  -access_denied_check(null,true)

- $form=$this->beginWidget('bootstrap.widgets.TbActiveForm',array(    |
	'id'=>'plate-list-form',                                            |
  'enableAjaxValidation'=>false,                                      |
  'htmlOptions'=>array('enctype' => 'multipart/form-data'),                                      |
));                                                                   |

%p
  =t('Fields with ')
  %span.required *
  =t(' are required.')
	 
	 
- if($model->isNewRecord)
  -if($canSeeAll)
    != $form->dropDownListRow($model,'mode',PlateList::getModeList(),array('class'=>'span5'))
  -else
    -if($canSeeBlack)
      -$model->mode = PlateList::MODE_BLACK_LIST
    -else
      -$model->mode = PlateList::MODE_WHITE_LIST
    != $form->textFieldRow($model,'mode',array('class'=>'span5','maxlength'=>255,'readonly'=>'readonly'))
- else
  != $form->textFieldRow($model,'mode',array('class'=>'span5','maxlength'=>255,'readonly'=>'readonly'))
!= $form->textFieldRow($model,'name',array('class'=>'span5','maxlength'=>255))
!= $form->textFieldRow($model,'title',array('class'=>'span5','maxlength'=>255))
!= $form->textFieldRow($model,'source',array('class'=>'span5','maxlength'=>255))
- if($model->isNewRecord)
  != $form->textFieldRow($model,'code',array('class'=>'span5'))
- else
  != $form->textFieldRow($model,'code',array('class'=>'span5','readonly'=>'readonly'))

%br
  %a.btn.btn-small(data-toggle="collapse" href="#advanced-fields")
    =t('Advanced Fields')
#advanced-fields.collapse
  != $form->checkboxRow($model,'auto_import')
  != $form->dropDownListRow($model,'import_type',PlateList::getImportType(), array('class'=>'span5'))
  != $form->textFieldRow($model,'import_folder',array('class'=>'span5','maxlength'=>255))
  != $form->checkboxRow($model,'editable')
  -if(user()->checkAccess('view_hidden_plate_list'))
    != $form->checkboxRow($model,'visible', array('id'=>'plate_list_visible'))
  -else
    %input(id="plate_list_visible" name="PlateList[visible]" value="1" checked="checked" type="hidden")
  != $form->checkboxRow($model,'downloadable')
  != $form->checkboxRow($model,'autoconfirm')
  != $form->textFieldRow($model,'autoconfirm_wait',array('class'=>'span5','maxlength'=>255))

  != $form->textFieldRow($model,'mintime',array('class'=>'span5','maxlength'=>255))
  != $form->textFieldRow($model,'maxtime',array('class'=>'span5','maxlength'=>255))
  != $form->textFieldRow($model,'maxsize',array('class'=>'span5'))

!= $form->fileFieldRow($model,'image',array('class'=>'span5','maxlength'=>255))

- $imgurl = $model->getImageUrl()
- if(!empty($imgurl))
  %br
  %img(src="#{$imgurl}" width="200")
  %a(href="#{Yii::app()->createAbsoluteUrl('plateList/removeImage', array('id'=>$model->id))}")
    =t('Remove').' [x]'

  
.form-actions
  - $this->widget('bootstrap.widgets.TbButton', array(             |
		'buttonType'=>'submit',                                        |
		'type'=>'primary',                                             |
		'label'=>$model->isNewRecord ? t('Create') : t('Save'),              |
	  ));                                                            |

- $this->endWidget()

