_heading.html.haml 2.04 KB
Newer Older
1
- if @pipeline
2
  .mr-widget-heading
3
    - %w[success success_with_warnings skipped canceled failed running pending].each do |status|
4
      .ci_widget{ class: "ci-#{status} ci-status-icon-#{status}", style: ("display:none" unless @pipeline.status == status) }
5 6
        = ci_icon_for_status(status)
        %span
7 8
          Pipeline
          = link_to "##{@pipeline.id}", namespace_project_pipeline_path(@pipeline.project.namespace, @pipeline.project, @pipeline.id), class: 'pipeline'
9 10 11 12 13
          = ci_label_for_status(status)
        for
        = succeed "." do
          = link_to @pipeline.short_sha, namespace_project_commit_path(@merge_request.source_project.namespace, @merge_request.source_project, @pipeline.sha), class: "monospace"
        %span.ci-coverage
Phil Hughes's avatar
Phil Hughes committed
14 15

- elsif @merge_request.has_ci?
16 17
  -# Compatibility with old CI integrations (ex jenkins) when you request status from CI server via AJAX
  -# TODO, remove in later versions when services like Jenkins will set CI status via Commit status API
Phil Hughes's avatar
Phil Hughes committed
18
  .mr-widget-heading
19
    - %w[success skipped canceled failed running pending].each do |status|
20
      .ci_widget{ class: "ci-#{status} ci-status-icon-#{status}", style: "display:none" }
21 22 23 24
        = ci_icon_for_status(status)
        %span
          CI build
          = ci_label_for_status(status)
25
        for
26
        - commit = @merge_request.diff_head_commit
27 28
        = succeed "." do
          = link_to commit.short_id, namespace_project_commit_path(@merge_request.source_project.namespace, @merge_request.source_project, commit), class: "monospace"
29
        %span.ci-coverage
30

Phil Hughes's avatar
Phil Hughes committed
31 32
    .ci_widget
      = icon("spinner spin")
33
      Checking CI status for #{@merge_request.diff_head_commit.short_id}…
Phil Hughes's avatar
Phil Hughes committed
34

35
    .ci_widget.ci-not_found{ style: "display:none" }
Phil Hughes's avatar
Phil Hughes committed
36
      = icon("times-circle")
37
      Could not find CI status for #{@merge_request.diff_head_commit.short_id}.
Phil Hughes's avatar
Phil Hughes committed
38

39
    .ci_widget.ci-error{ style: "display:none" }
Phil Hughes's avatar
Phil Hughes committed
40
      = icon("times-circle")
41
      Could not connect to the CI server. Please check your settings and try again.
42

43 44
.js-success-icon.hidden
  = ci_icon_for_status('success')