summaryrefslogtreecommitdiff
path: root/app/views/projects/builds/_header.html.haml
blob: a0f8f105d9a485b9ddddbbcfd21edb3f67b32a88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
- show_controls = local_assigns.fetch(:show_controls, true)
- pipeline = @build.pipeline

.content-block.build-header.top-area
  .header-content
    = render 'ci/status/badge', status: @build.detailed_status(current_user), link: false, title: @build.status_title
    %strong
      Job
      = link_to namespace_project_build_path(@project.namespace, @project, @build), class: 'js-build-id' do
        \##{@build.id}
    in pipeline
    = link_to pipeline_path(pipeline) do
      %strong ##{pipeline.id}
    for commit
    = link_to namespace_project_commit_path(@project.namespace, @project, pipeline.sha) do
      %strong= pipeline.short_sha
    from
    = link_to namespace_project_commits_path(@project.namespace, @project, @build.ref) do
      %code
        = @build.ref

    = render "projects/builds/user" if @build.user

    = time_ago_with_tooltip(@build.created_at)

  - if show_controls
    .nav-controls
      - if can?(current_user, :create_issue, @project) && @build.failed?
        = link_to "New issue", new_namespace_project_issue_path(@project.namespace, @project, issue: build_failed_issue_options), class: 'btn btn-new btn-inverted'
      - if can?(current_user, :update_build, @build) && @build.retryable?
        = link_to "Retry job", retry_namespace_project_build_path(@project.namespace, @project, @build), class: 'btn btn-inverted-secondary', method: :post
    %button.btn.btn-default.pull-right.visible-xs-block.visible-sm-block.build-gutter-toggle.js-sidebar-build-toggle{ role: "button", type: "button" }
      = icon('angle-double-left')