BigW Consortium Gitlab

_generic_commit_status.html.haml 1.98 KB
Newer Older
1 2 3
%tr.generic_commit_status
  %td.status
    - if can?(current_user, :read_commit_status, generic_commit_status) && generic_commit_status.target_url
4
      = ci_status_with_icon(generic_commit_status.status, generic_commit_status.target_url)
5 6 7 8 9 10 11 12 13 14 15 16 17
    - else
      = ci_status_with_icon(generic_commit_status.status)

  %td.generic_commit_status-link
    - if can?(current_user, :read_commit_status, generic_commit_status) && generic_commit_status.target_url
      = link_to generic_commit_status.target_url do
        %strong ##{generic_commit_status.id}
    - else
      %strong ##{generic_commit_status.id}

  - if defined?(commit_sha) && commit_sha
    %td
      = link_to generic_commit_status.short_sha, namespace_project_commit_path(generic_commit_status.project.namespace, generic_commit_status.project, generic_commit_status.sha), class: "monospace"
18 19 20 21 22 23 24

  - if defined?(ref) && ref
    %td
      - if generic_commit_status.ref
        = link_to generic_commit_status.ref, namespace_project_commits_path(generic_commit_status.project.namespace, generic_commit_status.project, generic_commit_status.ref)
      - else
        .light none
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 52 53 54 55 56 57 58 59

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

  - if defined?(stage) && stage
    %td
      = generic_commit_status.stage

  %td
    = generic_commit_status.name

    .pull-right
      - if generic_commit_status.tags.any?
        - generic_commit_status.tags.each do |tag|
          %span.label.label-primary
            = tag

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

  %td.timestamp
    - if generic_commit_status.finished_at
      %span #{time_ago_with_tooltip(generic_commit_status.finished_at)}

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

  %td