-if(!isset(Yii::app()->params['eventsToShow']) || Yii::app()->params['eventsToShow']!=="alarm")
  %h3= t('Last alerts')
-else
  %h3= t('Last alarms')  

%header
  .row.clearfix

    .span5
      .gate-description
        - if(isset($gate))
          %p.gate-name
            %i.icon-road
            = $gate->Descrizione
        - else
          %p.gate-name= t('All gates selected')
        %p.update-time
          = t("Updated at:")
          = DateHelper::formatLocalDateTime()

    .span3.pull-right
      .update-controls
        %form.form-inline
          %label.checkbox
            %input.automatic-alerts-preview(type="checkbox" checked="checked")= t('Automatic update')
          %button.update-alerts-preview.btn.btn-small(type="button")= t('Update')

%article.alerts
  - if (is_null($alerts))
    test
  - else
    - if (count($alerts)>0)
      %table.table.table-condensed
        %thead
          %tr
            %th
            %th= t('Event type')
            %th= t('Gate')
            %th= t('Date')
            %th= t('Time')
            %th= t('Km/h')
            -if(!isset(Yii::app()->params['eventsToShow']) || Yii::app()->params['eventsToShow']!=="alarm")
              %th= t('Kemler')
            %th= t('Class')
            %th= t('Colors')
            %th= t('License plate')
            %th

        %tbody
          - foreach($alerts as $alert)
            - $alertPresenter = new AlertPresenter($alert);
            - $this->renderPartial('alerts/_alertRow', array('alert' => $alertPresenter))
    - else                
      %div.spinner
        %div.bounce1
        %div.bounce2
        %div.bounce3


#modal-alert-photo-preview
