<table class='table'>
  <tr>
    <th>Package</th>
    <th colspan='2'>Control</th>
    <th colspan='2'>Test</th>
    <th>Diagnostics</th>
  </tr>
  <tr>
    <th>
      -
    </th>
    <th colspan='2'>
      <ul>
      <% @experiment.control_parameters.each do |key, value| %>
        <li><strong><%= key %></strong>: <%= value %></li>
      <% end %>
      </ul>
    </th>
    <th colspan='2'>
      <ul>
      <% @experiment.test_parameters.each do |key, value| %>
        <li><strong><%= key %></strong>: <%= value %></li>
      <% end %>
      </ul>
    </th>
    <th>
      -
    </th>
  </tr>
  <% @tests.records.each do |test| %>
    <tr>
      <td><%= test.control_job.package.name %></td>
      <td>
        <%== icon(test.control_job.status) %>
        <%= test.control_job.status || 'pending' %>
      </td>
      <td>
        <%== log_links(test.control_job) %>
      </td>
      <td>
        <%== icon(test.test_job.status) %>
        <%= test.test_job.status || 'pending' %>
      </td>
      <td>
        <%== log_links(test.test_job) %>
      </td>
      <td>
        <% if test.regression? %>
          <span class="badge text-bg-danger">Regression</span>
        <% elsif test.improvement? %>
          <span class="badge text-bg-success">Improvement</span>
        <% end %>
      </td>
    </tr>
  <% end %>
</table>


<%== erb(:pagination, locals: { results: @tests }) %>
