BigW Consortium Gitlab

_sidebar.html.haml 4.17 KB
Newer Older
Phil Hughes committed
1 2 3 4 5 6 7 8 9 10 11 12 13
%aside.right-sidebar.right-sidebar-expanded.build-sidebar.js-build-sidebar
  .block.build-sidebar-header.visible-xs-block.visible-sm-block.append-bottom-default
    Build
    %strong ##{@build.id}
    %a.gutter-toggle.pull-right.js-sidebar-build-toggle{ href: "#" }
      = icon('angle-double-right')
  - if @build.coverage
    .block.block-first
      .title
        Test coverage
      %p.build-detail-row
        #{@build.coverage}%

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

27 28 29
      - if @build.artifacts?
        .btn-group.btn-group-justified{ role: :group }
          - if @build.artifacts_expire_at
30
            = link_to keep_namespace_project_build_artifacts_path(@project.namespace, @project, @build), class: 'btn btn-sm btn-default', method: :post do
31 32 33 34
              Keep

          = link_to download_namespace_project_build_artifacts_path(@project.namespace, @project, @build), class: 'btn btn-sm btn-default' do
            Download
Phil Hughes committed
35

36 37 38
          - 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 committed
39

40
  .block{ class: ("block-first" if !@build.coverage && !(can?(current_user, :read_build, @project) && (@build.artifacts? || @build.artifacts_expired?))) }
Phil Hughes committed
41 42 43 44 45 46 47 48 49 50 51
    .title
      Build details
      - if @build.retryable?
        = link_to "Retry", retry_namespace_project_build_path(@project.namespace, @project, @build), class: 'pull-right', method: :post
    - if @build.merge_request
      %p.build-detail-row
        %span.build-light-text Merge Request:
        = link_to "#{@build.merge_request.to_reference}", merge_request_path(@build.merge_request)
    - if @build.duration
      %p.build-detail-row
        %span.build-light-text Duration:
52
        = time_interval_in_words(@build.duration)
Phil Hughes committed
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
    - 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)}
    %p.build-detail-row
      %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 }
      - if @build.has_trace?
        = 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

  - if @build.trigger_request
    .build-widget
      %h4.title
        Trigger

      %p
        %span.build-light-text Token:
        #{@build.trigger_request.trigger.short_token}

      - if @build.trigger_request.variables
        %p
          %span.build-light-text Variables:

        %code
          - @build.trigger_request.variables.each do |key, value|
            #{key}=#{value}

  .block
    .title
ubudzisz committed
97
      Commit title
98
    %p.build-light-text.append-bottom-0
99
      #{@build.pipeline.git_commit_title}
ubudzisz committed
100

Phil Hughes committed
101 102 103 104 105 106 107
  - if @build.tags.any?
    .block
      .title
        Tags
      - @build.tag_list.each do |tag|
        %span.label.label-primary
          = tag