.row.tbl-header
  .col-xs-12.col-md-2
    %h4 nodes /

.hidden.alert#flashMessage

.row
  .pull-right
    %form
      %button.ColVis_Button#reload{type: 'button'}
        %span.glyphicon.glyphicon-refresh Reload
      %button.ColVis_Button{type: 'button', onclick: 'history.go();'}
        %span.glyphicon.glyphicon-repeat Refresh

  .table-responsive
    %table.table.table-striped.table-hover.table-condensed#nodesTable
      %thead
        %tr
          %th Name
          %th IP
          %th Model
          %th Group
          %th Last Status
          %th Last Update
          %th Last Changed
          %th Actions

      %tbody
        - trclass = %w(even odd)
        - @data.sort_by{|e|e[:name]}.each do |node|
          - klass = trclass.rotate!.first
          %tr{class: "#{klass} ox-status-#{node[:status]}"}
            %td
              %a{href: url_for("/node/show/#{node[:name]}")} #{node[:name]}
            %td= node[:ip]
            %td
              %a{href: url_for("/nodes/model/#{node[:model]}")} #{node[:model]}
            %td
              %a{href: url_for("/nodes/group/#{node[:group]}")} #{node[:group]}
            %td
              %div{title: node[:status], class: node[:status]}
                %span{style: 'visibility: hidden'}#{node[:status]}
            %td.time= node[:time]
            %td.time= node[:mtime]
            %td
              %a{title: 'configuration',
                 href: url_for("/node/fetch/#{node[:full_name]}")}
                %span.glyphicon.glyphicon-cloud-download
                
              %a{title: 'versions',
                 href: url_for("/node/version?node_full=#{node[:full_name]}")}
                %img{src: url_for('/images/versioning_18px.png')}
                
              %a{title: 'update', href: url_for("/node/next/#{node[:full_name]}")}
                %span.glyphicon.glyphicon-repeat

:javascript
  $(function() {
    $('#nodesTable').dataTable({
      dom: 'C<"clear">lfrtip',
      bAutoWidth: false,
      "lengthMenu": [[50, 250, 500, -1], [50, 250, 500, "All"]],
      columnDefs: [{
        visible: false,
        targets: 1
      }, {
        type: "string",
        targets: 3
      }],
      colVis: {
        exclude: [0, 7]
      }
    });
  });