<div class='row'>
  <div class='col-md-12'>
    <h1 class='page-header'>Status <small>/ Pending Jobs</small></h1>
    <%== @status_nav %>

    <ol id='pending-nav' class='breadcrumb'>
      <li class='<%= "#{'active' if @current_page == 'status/pending'}" %>'>
        <a href='/status/pending/'>Latest <%= @status_per_page %> Jobs</a>
      </li>
      <li class='<%= "#{'active' if @current_page == 'status/pending/all'}" %>'>
          <a href='/status/pending/all/'>
            All  <span class='badge badge-pill'><%= @pending_jobs %></span>
          </a></li>

      <% @suites_jobs.each do |suite, jobs| %>
        <li class='<%= "#{'active' if @current_page.include?(suite)}" %>'>
          <span class='dropdown'>
            <a href='#' class='dropdown-toggle' data-toggle='dropdown'>
              <%= suite %>  <span class='badge badge-pill'><%= jobs %></span>
              <b class='caret'></b>
            </a>
            <ul class='dropdown-menu'>
              <li><a href='/<%= "status/pending/#{suite}/" %>'>Latest  <%= @status_per_page %> Jobs</a></li>
              <li><a href='/<%= "status/pending/#{suite}/all/" %>'>All Jobs</a></li>
            </ul>
          </span>
        </li> 
      <% end %>

    </ol>

    <% if not @pending.empty? %>
      <table class='table'>
        <tr>
          <th>Package</th>
          <th>Suite</th>
          <th>Architecture</th>
          <th>Requestor</th>
          <th>Trigger</th>
          <th>Requested</th>
        </tr>

      <% @pending.each do |job| %>
          <tr>
            <td>
              <a class='pending' href='/packages/<%= job.package.prefix %>/<%= job.package.name %>/<%= job.suite %>/<%= job.arch%>/'><%= job.package.name %></a>
            </td>
            <td>
              <a class='pending' href='/packages/<%= job.package.prefix %>/<%= job.package.name %>/<%= job.suite %>/<%= job.arch%>/'><%= job.suite %></a>
            </td>
            <td>
              <a class='pending' href='/packages/<%= job.package.prefix %>/<%= job.package.name %>/<%= job.suite %>/<%= job.arch%>/'><%= job.arch %></a>
            </td>
            <td>
              <a href="/user/<%= job.requestor %>/jobs?package=<%= job.package.name %>&suite[]=<%= job.suite %>&arch[]=<%= job.arch %>"><%= job.requestor %></a>
            </td>
            <td>
              <%= h job.trigger %></a>
            </td>
            <td>
              <%= job.created_at %> | <%= job.time %></a>
            </td>
          </tr>
      <% end %>
      </table>
    <% end %>

  </div> <!-- class='col-md-12' -->
</div> <!-- class='row' -->

<style>
.active {
  font-weight: bold;
}
</style>
