#sidebar= render 'shared/node_manager_sidebar'
#main

  .header
    %h2
      Search Latest Inspect Reports

  .item
    - if flash[:errors].present?
      %div{:class => "section error"}
        %h3 Errors
        - flash[:errors].each do |messages|
          %p
            - messages.each do |message|
              %li= message

    .section
      - form_tag url_for(:action => :search), :method => :get do
        = label_tag 'file_title', 'File title'
        = text_field_tag 'file_title', @title, :size => 100
        = label_tag 'file_content', 'File checksum (md5)'
        = text_field_tag 'file_content', @content, :size => 100
        %br
        %button Search

    - if @matching_files && @unmatching_files
      - [[:unmatching, @unmatching_files], [:matching, @matching_files]].each do |result_type, results|
        .section
          %h4= pluralize(results.count, "#{result_type} node")
          %table.inspector
            %thead
              %tr
                %th.status &nbsp;
                %th Time
                %th Node &uarr;
                %th Checksum
            %tbody
              - results.each do |file|
                %tr
                  = report_status_td(file.report)
                  %td= link_to file.report.time, file.report
                  %td= link_to h(file.report.host), file.report.node
                  %td= file.events.detect {|event| event.property == "content"}.previous_value.gsub("{md5}","") rescue "not recorded"
