%h1
  Cloud Upload

.float-right
  %p
    = link_to cloud_configuration_index_path do
      = sprite_tag('cog')
      Cloud upload configuration
.clear-both
%br/

%div
  %table#upload-jobs
    %thead
      %tr
        %th #
        %th Filename
        %th Details
        %th Platform
        %th Status
        %th Created
        %th
    %tbody
      - @upload_jobs.each do |job|
        %tr
          %td= job.id
          %td= link_to(job.filename, controller: '/webui/package', action: :binaries, project: job.project, package: job.package, repository: job.repository)
          %td= job.details
          %td= job.target.upcase
          %td= job.state
          %td= time_tag(job.created_at)
          %td
            = link_to "Log", cloud_upload_log_path(job.id)
            - unless ["succeeded", "failed"].include?(job.state)
              |
              = link_to 'Abort', cloud_upload_path(job.id),  method: :delete, data: { confirm: "Do you really want to abort job #{job.id}?" }
