BigW Consortium Gitlab

_commit_status.html.haml 2.34 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
%tr.commit_status
  %td.status
    = ci_status_with_icon(commit_status.status)

  %td.commit_status-link
    - if commit_status.target_url
      = link_to commit_status.target_url do
        %strong Build ##{commit_status.id}
    - else
      %strong Build ##{commit_status.id}

Kamil Trzcinski committed
12 13 14
    - if commit_status.show_warning?
      %i.fa.fa-warning.text-warning

Kamil Trzcinski committed
15 16 17
  - if defined?(commit_sha) && commit_sha
    %td
      = link_to commit_status.short_sha, namespace_project_commit_path(@project.namespace, @project, commit_status.sha), class: "monospace"
18 19

  %td
Kamil Trzcinski committed
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
    - if commit_status.ref
      = link_to commit_status.ref, namespace_project_commits_path(@project.namespace, @project, commit_status.ref)
    - else
      .light none

  - if defined?(runner) && runner
    %td
      - if commit_status.try(:runner)
        = runner_link(commit_status.runner)
      - else
        .light none

  - if defined?(stage) && stage
    %td
      = commit_status.stage
35 36

  %td
Kamil Trzcinski committed
37
    = commit_status.name
Kamil Trzcinski committed
38

39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
    .pull-right
      - if commit_status.tags.any?
        - commit_status.tags.each do |tag|
          %span.label.label-primary
            = tag
      - if commit_status.try(:trigger_request)
        %span.label.label-info triggered
      - if commit_status.try(:allow_failure)
        %span.label.label-danger allowed to fail

  %td.duration
    - if commit_status.duration
      #{duration_in_words(commit_status.finished_at, commit_status.started_at)}

  %td.timestamp
    - if commit_status.finished_at
Kamil Trzcinski committed
55
      %span #{time_ago_with_tooltip(commit_status.finished_at)}
56

Kamil Trzcinski committed
57
  - if defined?(coverage) && coverage
58 59 60 61 62
    %td.coverage
      - if commit_status.try(:coverage)
        #{commit_status.coverage}%

  %td
63
    .pull-right
64 65 66
      - if current_user && can?(current_user, :download_build_artifacts, @project) && commit_status.download_url
        = link_to commit_status.download_url, title: 'Download artifacts' do
          %i.fa.fa-download
67
      - if current_user && can?(current_user, :manage_builds, commit_status.gl_project)
Kamil Trzcinski committed
68 69 70 71
        - if commit_status.active?
          - if commit_status.cancel_url
            = link_to commit_status.cancel_url, method: :post, title: 'Cancel' do
              %i.fa.fa-remove.cred
72
        - elsif defined?(allow_retry) && allow_retry && commit_status.retry_url
Kamil Trzcinski committed
73
          = link_to commit_status.retry_url, method: :post, title: 'Retry' do
74
            %i.fa.fa-repeat