#main.full
  .header
    %h2
      Reports
      - if @node
        %span.alt for
        = link_to @node.name, @node
      %span.count== (#{@reports.total_entries})
  #item
    %table.main
      %thead
        %tr
          %th.status
            %span{:alt => "Status", :title => "Status"} &bull;
          %th Reported at &darr;
          - unless @node
            %th Host
          %th Total
          %th Failed
          %th Failed restarts
          %th Skipped
          %th Config retrieval
          %th Runtime
      %tbody
        - @reports.each do |report|
          %tr
            %td.status{:class => report.status, :alt => report.status.titleize, :title => report.status.titleize}
              %span &bull;
            %td= link_to report.time.to_s(:short), report
            - unless @node
              %td= link_to_if report.node, report.host, report.node
            %td= report.metrics[:resources][:total]
            %td= report.metrics[:resources][:failed]
            %td= report.metrics[:resources][:failed_restarts]
            %td= report.metrics[:resources][:skipped]
            %td= "%0.2f" % report.metrics[:time][:config_retrieval]
            %td= "%0.2f" % report.metrics[:time][:total]
      - if @reports.total_pages > 1
        %tfoot
          %tr
            %td{:colspan => @node ? 10 : 9}
              .actionbar
                = will_paginate(@reports)
                %div{:style => 'clear:both;'}

