Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-07-18 18:17:43 +0300
committerLin Jen-Shin <godfat@godfat.org>2016-07-18 18:18:16 +0300
commit57a78c37c72b2d697bc863ebfb84d3ca61ba9d7b (patch)
tree6b3778b5a62e4c01131f1f8291027033a798bf08 /app/views/projects/branches/_branch.html.haml
parent72699d9719a269a82be6af0812d86d84733c77bd (diff)
Show notice if builds are not from latest pipeline
Diffstat (limited to 'app/views/projects/branches/_branch.html.haml')
-rw-r--r--app/views/projects/branches/_branch.html.haml32
1 files changed, 18 insertions, 14 deletions
diff --git a/app/views/projects/branches/_branch.html.haml b/app/views/projects/branches/_branch.html.haml
index c2d7237f142..084a8474c4f 100644
--- a/app/views/projects/branches/_branch.html.haml
+++ b/app/views/projects/branches/_branch.html.haml
@@ -27,20 +27,24 @@
= link_to namespace_project_compare_index_path(@project.namespace, @project, from: @repository.root_ref, to: branch.name), class: 'btn btn-default', method: :post, title: "Compare" do
Compare
- - artifacts = @project.latest_success_builds_for(branch.name)
- - if artifacts.any?
- .dropdown.inline.artifacts-btn
- %a.btn.dropdown-toggle{ 'data-toggle' => 'dropdown' }
- = icon('download')
- %span.caret
- %span.sr-only
- Select Archive Format
- %ul.dropdown-menu.dropdown-menu-align-right{ role: 'menu' }
- %li.dropdown-header Artifacts
- - artifacts.each do |job|
- %li
- = link_to download_namespace_project_build_artifacts_path(@project.namespace, @project, job), rel: 'nofollow' do
- %span Download '#{job.name}'
+ - pipeline = @project.latest_success_pipeline_for(branch.name).first
+ - if pipeline
+ - artifacts = pipeline.builds.latest_success_with_artifacts
+ - if artifacts.any?
+ .dropdown.inline.artifacts-btn
+ %a.btn.dropdown-toggle{ 'data-toggle' => 'dropdown' }
+ = icon('download')
+ %span.caret
+ %span.sr-only
+ Select Archive Format
+ %ul.dropdown-menu.dropdown-menu-align-right{ role: 'menu' }
+ %li.dropdown-header Artifacts
+ - unless pipeline.latest?
+ = " (not latest, but #{link_to(pipeline.short_sha, namespace_project_commits_path(@project.namespace, @project, pipeline.sha))})"
+ - artifacts.each do |job|
+ %li
+ = link_to download_namespace_project_build_artifacts_path(@project.namespace, @project, job), rel: 'nofollow' do
+ %span Download '#{job.name}'
- if can_remove_branch?(@project, branch.name)
= link_to namespace_project_branch_path(@project.namespace, @project, branch.name), class: 'btn btn-remove remove-row has-tooltip', title: "Delete branch", method: :delete, data: { confirm: "Deleting the '#{branch.name}' branch cannot be undone. Are you sure?", container: 'body' }, remote: true do