_sidebar.html.haml 5.84 KB
Newer Older
1
- builds = @build.pipeline.builds.to_a
2

3
%aside.right-sidebar.right-sidebar-expanded.build-sidebar.js-build-sidebar.js-right-sidebar{ data: { "offset-top" => "101", "spy" => "affix" } }
Phil Hughes's avatar
Phil Hughes committed
4
  .block.build-sidebar-header.visible-xs-block.visible-sm-block.append-bottom-default
5
    Job
Phil Hughes's avatar
Phil Hughes committed
6 7 8 9
    %strong ##{@build.id}
    %a.gutter-toggle.pull-right.js-sidebar-build-toggle{ href: "#" }
      = icon('angle-double-right')
  - if @build.coverage
10
    .block.coverage
Phil Hughes's avatar
Phil Hughes committed
11 12 13 14 15
      .title
        Test coverage
      %p.build-detail-row
        #{@build.coverage}%

16 17 18 19
  .blocks-container
    - if can?(current_user, :read_build, @project) && (@build.artifacts? || @build.artifacts_expired?)
      .block{ class: ("block-first" if !@build.coverage) }
        .title
20
          Job artifacts
21 22 23 24
        - if @build.artifacts_expired?
          %p.build-detail-row
            The artifacts were removed
            #{time_ago_with_tooltip(@build.artifacts_expire_at)}
25
        - elsif @build.has_expiring_artifacts?
26 27 28
          %p.build-detail-row
            The artifacts will be removed in
            %span.js-artifacts-remove= @build.artifacts_expire_at
29

30 31
        - if @build.artifacts?
          .btn-group.btn-group-justified{ role: :group }
32
            - if @build.has_expiring_artifacts? && can?(current_user, :update_build, @build)
33 34
              = link_to keep_namespace_project_build_artifacts_path(@project.namespace, @project, @build), class: 'btn btn-sm btn-default', method: :post do
                Keep
35

36
            = link_to download_namespace_project_build_artifacts_path(@project.namespace, @project, @build), rel: 'nofollow', download: '', class: 'btn btn-sm btn-default' do
37
              Download
Phil Hughes's avatar
Phil Hughes committed
38

39 40 41
            - if @build.artifacts_metadata?
              = link_to browse_namespace_project_build_artifacts_path(@project.namespace, @project, @build), class: 'btn btn-sm btn-default' do
                Browse
Phil Hughes's avatar
Phil Hughes committed
42

43 44
    .block{ class: ("block-first" if !@build.coverage && !(can?(current_user, :read_build, @project) && (@build.artifacts? || @build.artifacts_expired?))) }
      .title
45
        Job details
46
        - if can?(current_user, :update_build, @build) && @build.retryable?
Filipa Lacerda's avatar
Filipa Lacerda committed
47
          = link_to "Retry job", retry_namespace_project_build_path(@project.namespace, @project, @build), class: 'pull-right retry-link', method: :post
48 49 50
      - if @build.merge_request
        %p.build-detail-row
          %span.build-light-text Merge Request:
Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
51
          = link_to "#{@build.merge_request.to_reference}", merge_request_path(@build.merge_request), class: 'bold'
52 53 54 55 56 57 58 59 60 61 62 63
      - if @build.duration
        %p.build-detail-row
          %span.build-light-text Duration:
          = time_interval_in_words(@build.duration)
      - if @build.finished_at
        %p.build-detail-row
          %span.build-light-text Finished:
          #{time_ago_with_tooltip(@build.finished_at)}
      - if @build.erased_at
        %p.build-detail-row
          %span.build-light-text Erased:
          #{time_ago_with_tooltip(@build.erased_at)}
Phil Hughes's avatar
Phil Hughes committed
64
      %p.build-detail-row
65 66 67 68 69 70
        %span.build-light-text Runner:
        - if @build.runner && current_user && current_user.admin
          = link_to "##{@build.runner.id}", admin_runner_path(@build.runner.id)
        - elsif @build.runner
          \##{@build.runner.id}
      .btn-group.btn-group-justified{ role: :group }
71
        - if @build.has_trace?
72 73 74 75 76 77 78 79
          = link_to 'Raw', raw_namespace_project_build_path(@project.namespace, @project, @build), class: 'btn btn-sm btn-default'
        - if @build.active?
          = link_to "Cancel", cancel_namespace_project_build_path(@project.namespace, @project, @build), class: 'btn btn-sm btn-default', method: :post
        - if can?(current_user, :update_build, @project) && @build.erasable?
          = link_to erase_namespace_project_build_path(@project.namespace, @project, @build),
                    class: "btn btn-sm btn-default", method: :post,
                    data: { confirm: "Are you sure you want to erase this build?" } do
            Erase
Phil Hughes's avatar
Phil Hughes committed
80

81 82 83 84
    - if @build.trigger_request
      .build-widget
        %h4.title
          Trigger
Phil Hughes's avatar
Phil Hughes committed
85 86

        %p
87 88
          %span.build-light-text Token:
          #{@build.trigger_request.trigger.short_token}
Phil Hughes's avatar
Phil Hughes committed
89

90 91
        - if @build.trigger_request.variables
          %p
ubudzisz's avatar
ubudzisz committed
92
            %button.btn.group.btn-group-justified.reveal-variables Reveal Variables
93

Phil Hughes's avatar
Phil Hughes committed
94

95
          - @build.trigger_request.variables.each do |key, value|
ubudzisz's avatar
ubudzisz committed
96
            .hide.js-build
97
              .js-build-variable= key
ubudzisz's avatar
ubudzisz committed
98
              .js-build-value= value
ubudzisz's avatar
ubudzisz committed
99

Phil Hughes's avatar
Phil Hughes committed
100 101
    .block
      .title
102 103 104 105 106 107 108 109 110 111 112
        Commit title
      %p.build-light-text.append-bottom-0
        #{@build.pipeline.git_commit_title}

    - if @build.tags.any?
      .block
        .title
          Tags
        - @build.tag_list.each do |tag|
          %span.label.label-primary
            = tag
113

114
    - if @build.pipeline.stages_count > 1
115 116
      .dropdown.build-dropdown
        .title Stage
117
        %button.dropdown-menu-toggle{ type: 'button', 'data-toggle' => 'dropdown' }
118
          %span.stage-selection More
119
          = icon('chevron-down')
120
        %ul.dropdown-menu
121
          - @build.pipeline.stages.each do |stage|
122
            %li
123
              %a.stage-item= stage.name
124 125

  .builds-container
126
    - HasStatus::ORDERED_STATUSES.each do |build_status|
127
      - builds.select{|build| build.status == build_status}.each do |build|
128
        .build-job{ class: sidebar_build_class(build, @build), data: { stage: build.stage } }
129
          = link_to namespace_project_build_path(@project.namespace, @project, build) do
130
            = icon('arrow-right')
131
            %span{ class: "ci-status-icon-#{build.status}" }
132
              = ci_icon_for_status(build.status)
133 134 135 136 137
            %span
              - if build.name
                = build.name
              - else
                = build.id
138
            - if build.retried?
139
              %i.fa.fa-spinner.has-tooltip{ data: { container: 'body', placement: 'bottom' }, title: 'Job was retried' }
140 141 142

:javascript
  new Sidebar();