%h1='Gates/Behaviors matrix'

%table.table.table-condensed
  %tr
    %td
    -foreach($gates as $g)
      %th(title="#{$g->Descrizione}")
        %a(href="#{url('gate/view',array('id'=>$g->ID))}" target="_blank")=$g->Gate
  -foreach($behaviors as $b)
    %tr
      %th=$b->name
      -foreach($gates as $g)
        -$gb = $matrix[$g->Gate][$b->ID]
        %td(title="[#{$g->Gate}] #{$g->Descrizione} => #{$b->name}")
          -if($gb == null)
            %a(style="color: salmon;" href="#{url('gateBehavior/matrixSwitch', array('g'=>$g->Gate,'b'=>$b->ID))}")
              .icon-off
          -else
            %a.color-green.icon-off(href="#{url('gateBehavior/matrixSwitch', array('g'=>$g->Gate,'b'=>$b->ID))}" onclick="return confirm('#{t('Confirm?')}');")



