<% @project = @image.package.project %>
<% @build_results.each_pair do |package, results| %>
  <div id="package_buildstatus">
    <table>
      <% results.each do |result| %>
        <% repository = @project.repositories.find_by_name(result.repository) %>
        <tr>
          <td class="arch">
            <div class="nowrap" style="margin: 0 0.5ex">
            <% if !(repository && repository.architectures.pluck(:name).include?(result.architecture)) %>
              <%= sprite_tag "time_error", alt: "Outdated result", title: "This result is outdated"%>
            <% else %>
              <%= repo_status_icon(result.state, result.details) %>
            <% end %>
            <%= result.architecture %>
            </div>
          </td>
          <%= arch_repo_table_cell(result.repository, result.architecture, package, { "code" => result.code, "details" => result.details }) %>
        </tr>
      <% end %>
    </table>
  </div>
<% end %>
<p style="padding: 0 1ex">
  <%= link_to(sprite_tag("package_go", alt: "Download Image", title: "Download Image") + ' Download images', { action: :binaries, controller: '/webui/package', project: @project, package: @image.package, repository: 'images' }, { title: 'Download images' }) %>
</p>
<%= javascript_tag do %>
  $('.unresolvable, .blocked').click(function() {
    var title = $(this).attr('title');
    alert(title);
  });
<% end %>
