BigW Consortium Gitlab

_heading.html.haml 2.01 KB
Newer Older
1
- if @ci_commit
2
  .mr-widget-heading
3
    .ci_widget{class: "ci-#{@ci_commit.status}"}
4
      = ci_status_icon(@ci_commit)
5 6 7
      %span
        Build
        = ci_status_label(@ci_commit)
8 9 10
      for
      = succeed "." do
        = link_to @ci_commit.short_sha, namespace_project_commit_path(@merge_request.source_project.namespace, @merge_request.source_project, @ci_commit.sha), class: "monospace"
11
      %span.ci-coverage
12
      = link_to "View details", builds_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), class: "js-show-tab", data: {action: 'builds'}
13 14 15 16 17

- elsif @merge_request.has_ci?
  - # Compatibility with old CI integrations (ex jenkins) when you request status from CI server via AJAX
  - # Remove in later versions when services like Jenkins will set CI status via Commit status API
  .mr-widget-heading
18
    - %w[success skipped canceled failed running pending].each do |status|
19
      .ci_widget{class: "ci-#{status}", style: "display:none"}
20 21 22 23
        = ci_icon_for_status(status)
        %span
          CI build
          = ci_label_for_status(status)
24 25 26 27
        for
        - commit = @merge_request.last_commit
        = succeed "." do
          = link_to commit.short_id, namespace_project_commit_path(@merge_request.source_project.namespace, @merge_request.source_project, commit), class: "monospace"
28
        %span.ci-coverage
29 30
        - if details_path = ci_build_details_path(@merge_request)
          = link_to "View details", details_path, :"data-no-turbolink" => "data-no-turbolink"
31

32 33 34
    .ci_widget
      = icon("spinner spin")
      Checking CI status for #{@merge_request.last_commit_short_sha}…
35

36 37 38
    .ci_widget.ci-not_found{style: "display:none"}
      = icon("times-circle")
      Could not find CI status for #{@merge_request.last_commit_short_sha}.
39

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

44 45 46 47
  :javascript
    $(function() {
      merge_request_widget.getCiStatus();
    });