#gate-group-index-page
  
  .page-header
    %h2
      %li.icon-cog
      = Yii::t("app", "Gate Groups")
      
  .row
    - $gateGroups = $dataProvider->data
    .tableContainer.pagination-data-container
      %table.table.table-condensed.span12
        %thead
          %tr
          %tr
            %th= t('ID')
            %th= t('Name')
            %th= t('Latitude')
            %th= t('Longitude')
            %th= t('Altitude')
            %th= t('Creation date')
            %th= t('In use')
            %th
              %a.btn.btn-mini(href="#{Yii::app()->createAbsoluteUrl('gateGroup/create')}")
                =Yii::t('app', 'New group')   

        %tbody
          - foreach($gateGroups as $gateGroup)
            -$cons = $gateGroup->getConsumers()
            -$inUse = count($cons)>0
            %tr
              %td
                =$gateGroup->ID
              %td
                !=SystemInfoHelper::getGateGroupCoolName($gateGroup->ID)
              %td
                =$gateGroup->latitude
              %td
                =$gateGroup->longitude
              %td
                =$gateGroup->altitude
              %td
                =$gateGroup->epoch
              %td
                -if($inUse)
                  =t('Yes')
                -else
                  =t('No')
              %td
                .btn-group
                  %a.btn.btn-small.dropdown-toggle(data-toggle="dropdown" href="#")
                    = Yii::t("app", "Actions")
                    %span.caret
                  %ul.dropdown-menu.pull-right
                    %li
                      %a(href="#{Yii::app()->createUrl('gateGroup/update', array('id' => $gateGroup->ID))}")
                        = Yii::t("app", ("Modify"))
                    -if(!$inUse)
                      %li
                        %a(href="#{Yii::app()->createUrl('gateGroup/delete', array('id' => $gateGroup->ID))}")
                          = Yii::t("app", ("Delete"))                
