BigW Consortium Gitlab

_pipeline.html.haml 5.23 KB
Newer Older
1
- status = pipeline.status
2 3 4
- show_commit = local_assigns.fetch(:show_commit, true)
- show_branch = local_assigns.fetch(:show_branch, true)

Kamil Trzcinski committed
5 6
%tr.commit
  %td.commit-link
7
    = render 'ci/status/badge', status: pipeline.detailed_status(current_user)
8 9

  %td
10
    = link_to namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id) do
11 12
      %span.pipeline-id ##{pipeline.id}
    %span by
13 14
    - if pipeline.user
      = user_avatar(user: pipeline.user, size: 20)
15 16
    - else
      %span.api.monospace API
17 18 19 20 21 22 23 24
    - if pipeline.latest?
      %span.label.label-success.has-tooltip{ title: 'Latest build for this branch' } latest
    - if pipeline.triggered?
      %span.label.label-primary triggered
    - if pipeline.yaml_errors.present?
      %span.label.label-danger.has-tooltip{ title: "#{pipeline.yaml_errors}" } yaml invalid
    - if pipeline.builds.any?(&:stuck?)
      %span.label.label-warning stuck
Kamil Trzcinski committed
25

26 27 28 29 30 31
  %td.branch-commit
    - if pipeline.ref && show_branch
      .icon-container
        = pipeline.tag? ? icon('tag') : icon('code-fork')
      = link_to pipeline.ref, namespace_project_commits_path(pipeline.project.namespace, pipeline.project, pipeline.ref), class: "monospace branch-name"
    - if show_commit
32
      .icon-container.commit-icon
33 34 35
        = custom_icon("icon_commit")
      = link_to pipeline.short_sha, namespace_project_commit_path(pipeline.project.namespace, pipeline.project, pipeline.sha), class: "commit-id monospace"

36 37 38
    %p.commit-title
      - if commit = pipeline.commit
        = author_avatar(commit, size: 20)
39
        = link_to_gfm truncate(commit.title, length: 60, escape: false), namespace_project_commit_path(pipeline.project.namespace, pipeline.project, commit.id), class: "commit-row-message"
40 41
      - else
        Cant find HEAD commit for this branch
Kamil Trzcinski committed
42

43
  %td.stage-cell
44
    - pipeline.stages.each do |stage|
45
      - if stage.status
46 47
        - status = ci_label_for_status(stage.detailed_status)
        - hasMultipleBuilds = stage.statuses.count > 1
48
        - tooltip = "#{stage.name.titleize}: #{stage.status || 'not found'}"
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65

        - if status
          .stage-container
            - if hasMultipleBuilds
              .dropdown.inline
                %a.dropdown-toggle{id: "dropdown-#{stage.name}", "data-toggle"=> "dropdown", "aria-haspopup"=> "true", "aria-expanded" => "false" }
                  = ci_icon_for_status(stage.detailed_status)
                  %span.caret
                .dropdown-menu.grouped-pipeline-dropdown{"aria-labelledby"=> "dropdown-#{stage.name}"}
                  .arrow
                    %ul
                      - stage.statuses.each do |status|
                        %li
                          status
            - else
              = link_to namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id, anchor: stage.name), class: "has-tooltip ci-status-icon-#{stage.status}", title: tooltip do
                = ci_icon_for_status(stage.detailed_status)
Kamil Trzcinski committed
66 67

  %td
68
    - if pipeline.duration
69
      %p.duration
70
        = custom_icon("icon_timer")
71
        = duration_in_numbers(pipeline.duration)
72
    - if pipeline.finished_at
73
      %p.finished-at
74
        = icon("calendar")
75
        #{time_ago_with_tooltip(pipeline.finished_at, short_format: false)}
Kamil Trzcinski committed
76

77 78
  %td.pipeline-actions.hidden-xs
    .controls.pull-right
79
      - artifacts = pipeline.builds.latest.with_artifacts_not_expired
80 81
      - actions = pipeline.manual_actions
      - if artifacts.present? || actions.any?
82
        .btn-group.inline
83
          - if actions.any?
84 85
            .btn-group
              %a.dropdown-toggle.btn.btn-default{type: 'button', 'data-toggle' => 'dropdown'}
86
                = custom_icon('icon_play')
87
                = icon('caret-down')
88
              %ul.dropdown-menu.dropdown-menu-align-right
89 90
                - actions.each do |build|
                  %li
91
                    = link_to play_namespace_project_build_path(pipeline.project.namespace, pipeline.project, build), method: :post, rel: 'nofollow' do
92
                      = custom_icon('icon_play')
Kamil Trzcinski committed
93
                      %span= build.name.humanize
94 95 96 97
          - if artifacts.present?
            .btn-group
              %a.dropdown-toggle.btn.btn-default.build-artifacts{type: 'button', 'data-toggle' => 'dropdown'}
                = icon("download")
98
                = icon('caret-down')
99 100 101
              %ul.dropdown-menu.dropdown-menu-align-right
                - artifacts.each do |build|
                  %li
102
                    = link_to download_namespace_project_build_artifacts_path(pipeline.project.namespace, pipeline.project, build), rel: 'nofollow' do
103 104
                      = icon("download")
                      %span Download '#{build.name}' artifacts
Kamil Trzcinski committed
105

106
      - if can?(current_user, :update_pipeline, pipeline.project)
107
        .cancel-retry-btns.inline
108
          - if pipeline.retryable?
109
            = link_to retry_namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id), class: 'btn has-tooltip', title: "Retry", method: :post do
110 111
              = icon("repeat")
          - if pipeline.cancelable?
112
            = link_to cancel_namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id), class: 'btn btn-remove has-tooltip', title: "Cancel", method: :post do
113
              = icon("remove")