_pipeline.html.haml 5.53 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's avatar
WIP  
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
Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
13 14
    - if pipeline.user
      = user_avatar(user: pipeline.user, size: 20)
Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
15 16
    - else
      %span.api.monospace API
17
    - if pipeline.latest?
Filipa Lacerda's avatar
Filipa Lacerda committed
18
      %span.label.label-success.has-tooltip{ title: 'Latest job for this branch' } latest
19 20 21 22 23 24
    - 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's avatar
WIP  
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
Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
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's avatar
Kamil Trzcinski committed
42

43
  %td.stage-cell
44
    - pipeline.stages.each do |stage|
45
      - if stage.status
Filipa Lacerda's avatar
Filipa Lacerda committed
46
        - detailed_status = stage.detailed_status(current_user)
Filipa Lacerda's avatar
Filipa Lacerda committed
47
        - icon_status = "#{detailed_status.icon}_borderless"
Filipa Lacerda's avatar
Filipa Lacerda committed
48
        - status_klass = "ci-status-icon ci-status-icon-#{detailed_status.group}"
49

50 51 52 53
        .stage-container.dropdown.js-mini-pipeline-graph
          %button.mini-pipeline-graph-dropdown-toggle.has-tooltip.js-builds-dropdown-button{ class: "ci-status-icon-#{detailed_status.group}", type: 'button', data: { toggle: 'dropdown', title: "#{stage.name}: #{detailed_status.label}", placement: 'top', "stage-endpoint" => stage_namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline, stage: stage.name) } }
            = custom_icon(icon_status)
            = icon('caret-down')
Kamil Trzcinski's avatar
Kamil Trzcinski committed
54

55 56 57 58 59 60
          %ul.dropdown-menu.mini-pipeline-graph-dropdown-menu.js-builds-dropdown-container
            .arrow-up
            .js-builds-dropdown-list.scrollable-menu

            .js-builds-dropdown-loading.builds-dropdown-loading.hidden
              %span.fa.fa-spinner.fa-spin
Kamil Trzcinski's avatar
Kamil Trzcinski committed
61

Kamil Trzcinski's avatar
WIP  
Kamil Trzcinski committed
62 63

  %td
64
    - if pipeline.duration
65
      %p.duration
66
        = custom_icon("icon_timer")
67
        = duration_in_numbers(pipeline.duration)
68
    - if pipeline.finished_at
69
      %p.finished-at
70
        = icon("calendar")
71
        #{time_ago_with_tooltip(pipeline.finished_at, short_format: false)}
Kamil Trzcinski's avatar
WIP  
Kamil Trzcinski committed
72

73 74
  %td.pipeline-actions.hidden-xs
    .controls.pull-right
75
      - artifacts = pipeline.builds.latest.with_artifacts_not_expired
76 77
      - actions = pipeline.manual_actions
      - if artifacts.present? || actions.any?
78
        .btn-group.inline
79
          - if actions.any?
80
            .btn-group
Filipa Lacerda's avatar
Filipa Lacerda committed
81
              %button.dropdown-toggle.btn.btn-default.has-tooltip.js-pipeline-dropdown-manual-actions{ type: 'button', title: 'Manual job', data: { toggle: 'dropdown', placement: 'top' }, 'aria-label' => 'Manual job' }
82
                = custom_icon('icon_play')
83
                = icon('caret-down', 'aria-hidden' => 'true')
84
              %ul.dropdown-menu.dropdown-menu-align-right
85 86
                - actions.each do |build|
                  %li
87
                    = link_to play_namespace_project_build_path(pipeline.project.namespace, pipeline.project, build), method: :post, rel: 'nofollow' do
88
                      = custom_icon('icon_play')
89
                      %span= build.name
90 91
          - if artifacts.present?
            .btn-group
92
              %button.dropdown-toggle.btn.btn-default.build-artifacts.has-tooltip.js-pipeline-dropdown-download{ type: 'button', title: 'Artifacts', data: { toggle: 'dropdown', placement: 'top' }, 'aria-label' => 'Artifacts' }
93
                = icon("download")
94
                = icon('caret-down')
95 96 97
              %ul.dropdown-menu.dropdown-menu-align-right
                - artifacts.each do |build|
                  %li
98
                    = link_to download_namespace_project_build_artifacts_path(pipeline.project.namespace, pipeline.project, build), rel: 'nofollow' do
99 100
                      = icon("download")
                      %span Download '#{build.name}' artifacts
Kamil Trzcinski's avatar
WIP  
Kamil Trzcinski committed
101

102
      - if can?(current_user, :update_pipeline, pipeline.project)
103
        .cancel-retry-btns.inline
104
          - if pipeline.retryable?
105
            = link_to retry_namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id), class: 'btn has-tooltip', title: 'Retry', data: { toggle: 'dropdown', placement: 'top' }, 'aria-label' => 'Retry' , method: :post do
106 107
              = icon("repeat")
          - if pipeline.cancelable?
108
            = link_to cancel_namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id), class: 'btn btn-remove has-tooltip', title: 'Cancel', data: { toggle: 'dropdown', placement: 'top' }, 'aria-label' => 'Cancel' , method: :post do
109
              = icon("remove")