summaryrefslogtreecommitdiff
path: root/app/views/projects/commit_statuses/_commit_status.html.haml
blob: e3a17faf0bd947a8d2fbefaf8bb0fa6a8d10fec0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
%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}

  %td
    = commit_status.ref

  %td
    = commit_status.stage

  %td
    = commit_status.name
    .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
      %span #{time_ago_in_words commit_status.finished_at} ago

  - if defined?(coverage) && coverage
    %td.coverage
      - if commit_status.try(:coverage)
        #{commit_status.coverage}%

  %td
    - if defined?(controls) && controls && current_user && can?(current_user, :manage_builds, gl_project)
      .pull-right
        - if commit_status.cancel_url
          = link_to commit_status.cancel_url, title: 'Cancel' do
            %i.fa.fa-remove.cred
        - elsif commit_status.retry_url
          = link_to commit_status.retry_url, method: :post, title: 'Retry' do
            %i.fa.fa-repeat