<%= javascript "jquery.cookie", "host_checkbox", "foreman_openscap/arf_reports" %>

<table class="table table-bordered table-striped ellipsis">
  <tr>
  <th class="ca" width="40px"><%= check_box_tag "check_all", "", false, { :onclick => "toggleCheck()", :'check-title' => _("Select all items in this page"), :'uncheck-title'=> _("items selected. Uncheck to Clear") } %></th>
    <th><%= sort :host %></th>
    <th><%= sort :reported, :as => _("Reported At") %></th>
    <th><%= sort :compliance_passed, :as => _("Passed") %></th>
    <th><%= sort :compliance_failed, :as => _("Failed") %></th>
    <th><%= sort :compliance_othered, :as => _("Other") %></th>
    <th></th>
  </tr>
  <% for arf_report in @arf_reports %>
    <tr>
    <td class="ca">
          <%= check_box_tag "host_ids[]",
                             nil,
                             false,
                             :id => "host_ids_#{arf_report.id}",
                             :disabled => !authorized_for(:controller => :arf_reports, :action => :destroy),
                             :class => 'host_select_boxes',
                             :onclick => 'hostChecked(this)' %>
        </td>
      <td><%= name_column(arf_report.host) %></td>
      <td><%= display_link_if_authorized(_("%s ago") % time_ago_in_words(arf_report.reported_at), hash_for_arf_report_path(:id => arf_report.id)) %></td>
      <td><%= report_arf_column(arf_report.passed, "label-info") %></th>
      <td><%= report_arf_column(arf_report.failed, "label-danger") %></th>
      <td><%= report_arf_column(arf_report.othered, "label-warning") %></th>
      <td>
        <%= display_delete_if_authorized(hash_for_arf_report_path(:id => arf_report.id),
                                         :confirm => _("Delete compliance report for %s?") % arf_report.host)
        %>
      </td>
    </tr>
  <% end %>
</table>
<div id="confirmation-modal" class="modal fade">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title"><%= _('Please Confirm') %></h4>
      </div>
      <div class="modal-body">
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal"><%= _('Cancel') %></button>
        <button type="button" class="btn btn-primary" onclick="submit_modal_form()"><%= _('Submit') %></button>
      </div>
    </div>
  </div>
</div>
<%= will_paginate_with_info @arf_reports %>