_pipeline.html.haml 4.5 KB
Newer Older
1
- status = pipeline.status
K
WIP  
Kamil Trzcinski 已提交
2 3
%tr.commit
  %td.commit-link
A
Annabel Dunstone 已提交
4
    = link_to namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id) do
5 6 7 8
      - if defined?(status_icon_only) && status_icon_only
        = ci_icon_for_status(status)
      - else
        = ci_status_with_icon(status)
K
WIP  
Kamil Trzcinski 已提交
9
  %td
10
    .branch-commit
A
Annabel Dunstone 已提交
11
      = link_to namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id) do
A
Annabel Dunstone 已提交
12
        %span ##{pipeline.id}
13
      - if pipeline.ref
14 15 16
        - unless defined?(hide_branch) && hide_branch
          .icon-container
            = pipeline.tag? ? icon('tag') : icon('code-fork')
A
Annabel Dunstone 已提交
17
          = link_to pipeline.ref, namespace_project_commits_path(pipeline.project.namespace, pipeline.project, pipeline.ref), class: "monospace branch-name"
18 19
      .icon-container
        = custom_icon("icon_commit")
A
Annabel Dunstone 已提交
20
      = link_to pipeline.short_sha, namespace_project_commit_path(pipeline.project.namespace, pipeline.project, pipeline.sha), class: "commit-id monospace"
A
Annabel Dunstone 已提交
21
      - if pipeline.latest?
22
        %span.label.label-success.has-tooltip{ title: 'Latest build for this branch' } latest
23
      - if pipeline.triggered?
K
WIP  
Kamil Trzcinski 已提交
24
        %span.label.label-primary triggered
25 26 27
      - if pipeline.yaml_errors.present?
        %span.label.label-danger.has-tooltip{ title: "#{pipeline.yaml_errors}" } yaml invalid
      - if pipeline.builds.any?(&:stuck?)
K
WIP  
Kamil Trzcinski 已提交
28 29
        %span.label.label-warning stuck

30
      %p.commit-title
31
        - if commit = pipeline.commit
32
          = author_avatar(commit, size: 20)
A
Annabel Dunstone 已提交
33
          = link_to_gfm truncate(commit.title, length: 60), namespace_project_commit_path(pipeline.project.namespace, pipeline.project, commit.id), class: "commit-row-message"
34 35
        - else
          Cant find HEAD commit for this branch
K
Kamil Trzcinski 已提交
36

K
WIP  
Kamil Trzcinski 已提交
37

38
    - stages_status = pipeline.statuses.relevant.latest.stages_status
K
WIP  
Kamil Trzcinski 已提交
39
    - stages.each do |stage|
40
      %td.stage-cell
41 42 43
        - status = stages_status[stage]
        - tooltip = "#{stage.titleize}: #{status || 'not found'}"
        - if status
A
Annabel Dunstone 已提交
44
          = link_to namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id, anchor: stage), class: "has-tooltip ci-status-icon-#{status}", title: tooltip do
K
Kamil Trzcinski 已提交
45
            = ci_icon_for_status(status)
46
        - else
K
Kamil Trzcinski 已提交
47
          .light.has-tooltip{ title: tooltip }
48
            \-
K
WIP  
Kamil Trzcinski 已提交
49 50

  %td
51
    - if pipeline.duration
52
      %p.duration
53
        = custom_icon("icon_timer")
54
        = duration_in_numbers(pipeline.duration)
55
    - if pipeline.finished_at
56
      %p.finished-at
57
        = icon("calendar")
58
        #{time_ago_with_tooltip(pipeline.finished_at, short_format: false, skip_js: true)}
K
WIP  
Kamil Trzcinski 已提交
59

60
  %td.pipeline-actions
K
WIP  
Kamil Trzcinski 已提交
61
    .controls.hidden-xs.pull-right
62
      - artifacts = pipeline.builds.latest.with_artifacts_not_expired
63 64
      - actions = pipeline.manual_actions
      - if artifacts.present? || actions.any?
65
        .btn-group.inline
66
          - if actions.any?
67 68 69 70 71
            .btn-group
              %a.dropdown-toggle.btn.btn-default{type: 'button', 'data-toggle' => 'dropdown'}
                = icon("play")
                %b.caret
              %ul.dropdown-menu.dropdown-menu-align-right
72 73
                - actions.each do |build|
                  %li
A
Annabel Dunstone 已提交
74
                    = link_to play_namespace_project_build_path(pipeline.project.namespace, pipeline.project, build), method: :post, rel: 'nofollow' do
75
                      = icon("play")
K
Kamil Trzcinski 已提交
76
                      %span= build.name.humanize
77 78 79 80 81 82 83 84
          - if artifacts.present?
            .btn-group
              %a.dropdown-toggle.btn.btn-default.build-artifacts{type: 'button', 'data-toggle' => 'dropdown'}
                = icon("download")
                %b.caret
              %ul.dropdown-menu.dropdown-menu-align-right
                - artifacts.each do |build|
                  %li
A
Annabel Dunstone 已提交
85
                    = link_to download_namespace_project_build_artifacts_path(pipeline.project.namespace, pipeline.project, build), rel: 'nofollow' do
86 87
                      = icon("download")
                      %span Download '#{build.name}' artifacts
K
WIP  
Kamil Trzcinski 已提交
88

A
Annabel Dunstone 已提交
89
      - if can?(current_user, :update_pipeline, pipeline.project)
90
        .cancel-retry-btns.inline
91
          - if pipeline.retryable?
A
Annabel Dunstone 已提交
92
            = link_to retry_namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id), class: 'btn has-tooltip', title: "Retry", method: :post do
93 94
              = icon("repeat")
          - if pipeline.cancelable?
A
Annabel Dunstone 已提交
95
            = 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
96
              = icon("remove")