- $types = $model->types; 
- $datePickerOption = array('dateFormat'=>'yy-mm-dd', 'changeMonth' => 'true', 'changeYear'=>'true',  'constrainInput' => 'false'); 

#diagnostic-search-page

  .page-header
    %h2= t('Diagnostics')

  .row
    .form-box 
      - $form = $this->beginWidget('bootstrap.widgets.TbActiveForm',       |
                array(                                                     |
                'id'=>'diagnostic-search-form',                                  |
                'action' => Yii::app()->createUrl($this->route),           |
              ))                                                           |
      .span11
        %fieldset
         
          %select#gate-filter.selectpicker.span3(multiple="multiple" data-live-search="false" title="#{t('Select gates...')}" name="DiagnosticSearchForm[gates][]")
            - foreach($gateList as $theGate)
              - if(in_array($theGate->Gate, $model->gates))
                %option(value="#{$theGate->Gate}" selected="selected")
                  = $theGate->Descrizione
              - else    
                %option(value="#{$theGate->Gate}")
                  = $theGate->Descrizione
        
                
          .btn-group#alert-filter-buttons.span2(style="margin-bottom: 10px")
            - if(isset($types)  && in_array('alarm', $types))
              %button#alert-alarm-filter-button.filter-buttons.btn.active(type="button" data-filter="alarm")
                %i.icon-exclamation-sign.alarm.alarm-icon
            -else    
              %button#alert-alarm-filter-button.filter-buttons.btn(type="button" data-filter="alarm")
                %i.icon-exclamation-sign.alarm.alarm-icon
            - if(isset($types)  && in_array('warning', $types))    
              %button#alert-warning-filter-button.filter-buttons.btn.active(type="button" data-filter="warning")
                %i.icon-warning-sign.alarm.warning-icon
            -else    
              %button#alert-warning-filter-button.filter-buttons.btn(type="button" data-filter="warning")
                %i.icon-warning-sign.alarm.warning-icon
    
            - if(isset($types)  && in_array('info', $types))    
              %button#alert-info-filter-button.filter-buttons.btn.active(type="button" data-filter="info")
                %i.icon-info-sign.alarm.info-icon
            - else    
              %button#alert-info-filter-button.filter-buttons.btn(type="button" data-filter="info")
                %i.icon-info-sign.alarm.info-icon
   
        
          .btn-group#alert-filter-status-buttons.span3(style="margin-bottom: 10px")
            - if(isset($model->takenInChargeBy)  && $model->takenInChargeBy > 0)
              %button#alert-takenincharge-filter-button.filter-buttons.btn.active(type="button" data-filter="takenincharge" style="width:auto")
                =t("Taken in charge")
            -else    
              %button#alert-takenincharge-filter-button.filter-buttons.btn(type="button" data-filter="takenincharge" style="width:auto")
                =t("Taken in charge")
            - if(isset($model->closedBy)  && $model->closedBy > 0)
              %button#alert-closed-filter-button.filter-buttons.btn.active(type="button" data-filter="closed")
                =t("Closed")
            -else    
              %button#alert-closed-filter-button.filter-buttons.btn(type="button" data-filter="closed")
                =t("Closed")      
      .span11
        #alarm-filter-hidden-field-container  
        #alarm-status-filter-hidden-field-container
          %input(type="hidden" id="input-field-status-filter-takenincharge" name="DiagnosticSearchForm[takenInChargeBy]" value="0")
          %input(type="hidden" id="input-field-status-filter-closed" name="DiagnosticSearchForm[closedBy]" value="0")          
  
        #date-time-range-search.span6(data-behavior="DateRangeInput" data-date-range-start-target='#search-date-start' data-date-range-end-target='#search-date-end')
          .date-time-range-block.span
            = t("From")
            #search-date-start.input-append.date.datetime-picker
              %input(data-format="#{Yii::app()->params['datetimeselect_format'][Yii::app()->language]['view']}" type="text" name="DiagnosticSearchForm[startDateTime]" value="#{$model->startDateTime}")
                %span.add-on
                  %i(data-time-icon="icon-time" data-date-icon="icon-calendar")
          .date-time-range-block.span
            = t("To")      
            #search-date-end.input-append.date.datetime-picker
              %input(data-format="#{Yii::app()->params['datetimeselect_format'][Yii::app()->language]['view']}" type="text" name="DiagnosticSearchForm[endDateTime]"  value="#{$model->endDateTime}")
                %span.add-on
                  %i(data-time-icon="icon-time" data-date-icon="icon-calendar")
   
   
        %button#search-for-alert.pull-right.btn(type="submit")
          = t("Search")
             
        %button#search-for-alert.pull-right.btn(type="submit" name="exportbtn" value="export")
          = t("Export")
             
             
      - $this->endWidget()
 
          
  .row                     
    #event-reporting-list(data-behavior="SlidePagination" data-page-form="#diagnostic-search-form")
      - $this->renderPartial('_diagnosticTable', array('dataProvider' => $dataProvider))