- $isBlack = $list->mode == PlateList::MODE_BLACK_LIST
- if($isBlack)
  - $imgurl = $list->getImageUrl('/images/list_black.png')
- else
  - $imgurl = $list->getImageUrl('/images/list_white.png')

- $listType = $isBlacklist ? 'Blacklist' : 'Whitelist';

-if(isset($_POST['NewPlateAuthProfileForm']))
  -/*var_dump_html($_POST['NewPlateAuthProfileForm'])*/
  
#plate-authorization-page
  .page-header
    %table(width="100%")
      %tr
        %td
          %h2
            %i.icon-ok-circle
            -if(user()->checkAccess('plate_auth_confirmed') || $isBlack)
              = Yii::t('app', "Add vehicle").': '.$list->getListTitle()
            -else
              = Yii::t('app', "Request to add vehicle").': '.$list->getListTitle()
        %td
          -if(!empty($imgurl))
            %img(src="#{$imgurl}" width="100" align="right")

  !=$form->errorSummary($model)
  -$columns = array()
  -foreach($fields as $field)
    -array_add_unique($columns, $field->column)
  -$columnSize = (int)(100/count($columns))
  -$comments = array()
  
  %form#new-profile-plate-auth(method="POST")
    %input(type="hidden" name="doit" value="doit")
    %table(style="width: 100%;")
      %tr
        -foreach($columns as $columnIndex)
          %td(style="width: #{$columnSize}%; vertical-align: top;")
            %fieldset
              -$currentGroup = null
              -foreach($fields as $field)
                -if(!isEmptyOrWhitespace($field->comment))
                  -$comments[$field->name] = $field->comment
                -if($field->column == $columnIndex)
                  .row
                    -if($field->visible)
                      -if($currentGroup != $field->group)
                        -$currentGroup = $field->group
                        %h4 
                          = t(ucfirst($field->group))
                      -if($field->type == PlateAuthInsertProfileFieldType::STRING)
                        -$this->renderPartial('insertProfile/_fieldText',get_defined_vars())
                      -elseif($field->type == PlateAuthInsertProfileFieldType::MULTILINESTRING)
                        -$this->renderPartial('insertProfile/_fieldTextArea',get_defined_vars())
                      -elseif($field->type == PlateAuthInsertProfileFieldType::CHECKBOX)
                        -$this->renderPartial('insertProfile/_fieldCheckbox',get_defined_vars())
                      -elseif($field->type == PlateAuthInsertProfileFieldType::DROPDOWN)
                        -$this->renderPartial('insertProfile/_fieldDropdown',get_defined_vars())
                      -elseif($field->type == PlateAuthInsertProfileFieldType::DATE)
                        -$this->renderPartial('insertProfile/_fieldDate',get_defined_vars())
                      -elseif($field->type == PlateAuthInsertProfileFieldType::TIME)
                        -$this->renderPartial('insertProfile/_fieldTime',get_defined_vars())
                      -elseif($field->type == PlateAuthInsertProfileFieldType::DATEBUTTONS)
                        -$this->renderPartial('insertProfile/_fieldDateButtons',get_defined_vars())              
                      -else
                        =''              
                    -else
                      -$this->renderPartial('insertProfile/_fieldHidden',get_defined_vars())
                    
    %button#save-btn.btn(type="button" data-confirm-text="#{Yii::t('app', 'Confirm')}" data-form-action="#{url('plateAuthorization/NewPlateAuthProfile', array('plateListId'=>$list->code,'profileId'=>$profile->id))}" data-target="#new-profile-plate-auth")= Yii::t('app', 'Create')
    %br
    %br
    
    -if(count($comments)>0)
      #field-comments-box(style="border: 1px gray solid; border-radius: 5px; background-color: azure; padding: 5px 5px 5px 5px;")
        %h5=t('Comments')
        #field-comments
          -foreach($comments as $fieldName => $fieldComment)      
            %i(style="position: relative; left: 10px; display: block;")
              %a(href="#field_#{$fieldName}")
                %b
                  =t($fields[$fieldName]->label)
              =': '
              =$fieldComment
        