<div class='row'>
  <div class='col-lg-12'>
    <nav aria-label="breadcrumb">
      <ol class='breadcrumb'>
        <li class="breadcrumb-item"><a href='/packages/<%= @package.prefix %>/'><%= @package.prefix %></a></li>
        <li class='breadcrumb-item active'><%= @package.name %></li>
      </ol>
    </nav>

    <h2>
      <%= @package.name %>
      <%== erb(:package_links) %>
    </h2>

  <% if @package.reject_listed? %> 
    <div class='alert alert-warning'>
      This package is currently <a href="/status/reject_list/">reject_listed</a> and will not have any new test runs.
    </div> 
  <% end %>

  <% no_ref = false %>

    <table class="table" style='width: auto'>

      <tr>
        <td></td>
        <% Debci.config.suite_list.each do |suite| %>
          <td><b><%= suite %></b></td>
        <% end %>
      </tr>
      <% Debci.config.arch_list.each_with_index do |arch, a| %>
        <tr>
          <td>
            <%= arch %>
          </td>
          <% Debci.config.suite_list.each_with_index do |suite, s| %>
            <td>
              <% if status = @package.status[a][s] %>
                <a href="<%= history_url(status) %>">
                  <%== icon(status.status) %>
                  <%= status.title %>
                </a>
              <% else %>
                <% no_ref = true %>
                <a href="<%= pkg_history_url(@package, suite, arch) %>">
                  <%== icon(:no_test_data) %>
                  No reference
                </a>
                <sup>*</sup>
              <% end %>
            </td>
          <% end %>
        </tr>
      <% end %>

    </table>

    <% if no_ref %>
      <p class="alert alert-info">
      <strong><sup>*</sup>No reference</strong>:
      there is no test data for the given suite and architecture without packages
      from a different suite. Maybe there is some test data.
      </p>
    <% end %>

    <h3>Pending Jobs</h3>
    <% if not @pending_jobs.empty? %>
      <%== erb(:job_listing, locals: { jobs_list: @pending_jobs, fields: [:package, :suite, :arch, :requestor, :trigger, :requested ]}) %>
    <% else %>
        <em>(none)</em>
    <% end %>
  </div>
</div>
