_pipeline.html.haml 4.6 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)

K
WIP  
Kamil Trzcinski 已提交
5 6
%tr.commit
  %td.commit-link
A
Annabel Dunstone 已提交
7
    = link_to namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id) do
8 9 10 11
      - if defined?(status_icon_only) && status_icon_only
        = ci_icon_for_status(status)
      - else
        = ci_status_with_icon(status)
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
  %td.branch-commit
    = link_to namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id) do
      %span ##{pipeline.id}
    - 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
      .icon-container
        = custom_icon("icon_commit")
      = link_to pipeline.short_sha, namespace_project_commit_path(pipeline.project.namespace, pipeline.project, pipeline.sha), class: "commit-id monospace"
    - 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
K
WIP  
Kamil Trzcinski 已提交
31

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

K
WIP  
Kamil Trzcinski 已提交
39

40
    - stages_status = pipeline.statuses.relevant.latest.stages_status
41 42
    %td.stage-cell
      - stages.each do |stage|
43 44
        - status = stages_status[stage]
        - tooltip = "#{stage.titleize}: #{status || 'not found'}"
45 46
        - if status
          .stage-container
47 48
            = 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
              = ci_icon_for_status(status)
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 61
  %td.pipeline-actions.hidden-xs
    .controls.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
            .btn-group
              %a.dropdown-toggle.btn.btn-default{type: 'button', 'data-toggle' => 'dropdown'}
C
Clement Ho 已提交
69
                = custom_icon('icon_play')
70 71
                %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
C
Clement Ho 已提交
75
                      = custom_icon('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")