summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-08-16 22:10:10 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-08-16 22:10:10 +0800
commitf86a507745695f3b073d6edb6029836ab115765a (patch)
tree68e3833fe640ee74be6b7c197cd614317570b129
parent11f840bfa5b93fdd0687c9c4f2a5a2e7abbc17ac (diff)
downloadgitlab-ce-f86a507745695f3b073d6edb6029836ab115765a.tar.gz
Rename to latest_succeeded, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5142#note_13908017
-rw-r--r--app/controllers/projects/artifacts_controller.rb2
-rw-r--r--app/views/projects/branches/_branch.html.haml2
-rw-r--r--app/views/projects/buttons/_download.html.haml2
-rw-r--r--app/views/projects/tags/_download.html.haml2
-rw-r--r--config/routes.rb7
5 files changed, 8 insertions, 7 deletions
diff --git a/app/controllers/projects/artifacts_controller.rb b/app/controllers/projects/artifacts_controller.rb
index b7c395a01a3..5cc6d643b64 100644
--- a/app/controllers/projects/artifacts_controller.rb
+++ b/app/controllers/projects/artifacts_controller.rb
@@ -34,7 +34,7 @@ class Projects::ArtifactsController < Projects::ApplicationController
redirect_to namespace_project_build_path(project.namespace, project, build)
end
- def search
+ def latest_succeeded
path = params[:path]
if %w[download browse file].include?(path)
diff --git a/app/views/projects/branches/_branch.html.haml b/app/views/projects/branches/_branch.html.haml
index 12b78be4be0..5634abf3641 100644
--- a/app/views/projects/branches/_branch.html.haml
+++ b/app/views/projects/branches/_branch.html.haml
@@ -46,7 +46,7 @@
%li.dropdown-header Previous Artifacts
- artifacts.each do |job|
%li
- = link_to search_namespace_project_artifacts_path(@project.namespace, @project, branch.name, 'download', job: job.name), rel: 'nofollow' do
+ = link_to latest_succeeded_namespace_project_artifacts_path(@project.namespace, @project, branch.name, 'download', job: job.name), rel: 'nofollow' do
%span Download '#{job.name}'
- if can_remove_branch?(@project, branch.name)
diff --git a/app/views/projects/buttons/_download.html.haml b/app/views/projects/buttons/_download.html.haml
index 45998343fda..177946dcd42 100644
--- a/app/views/projects/buttons/_download.html.haml
+++ b/app/views/projects/buttons/_download.html.haml
@@ -26,5 +26,5 @@
%li.dropdown-header Previous Artifacts
- artifacts.each do |job|
%li
- = link_to search_namespace_project_artifacts_path(@project.namespace, @project, @ref, 'download', job: job.name), rel: 'nofollow' do
+ = link_to latest_succeeded_namespace_project_artifacts_path(@project.namespace, @project, @ref, 'download', job: job.name), rel: 'nofollow' do
%span Download '#{job.name}'
diff --git a/app/views/projects/tags/_download.html.haml b/app/views/projects/tags/_download.html.haml
index 60f1e2cd2ee..316d03dd12a 100644
--- a/app/views/projects/tags/_download.html.haml
+++ b/app/views/projects/tags/_download.html.haml
@@ -24,5 +24,5 @@
%li.dropdown-header Previous Artifacts
- artifacts.each do |job|
%li
- = link_to search_namespace_project_artifacts_path(project.namespace, project, ref, 'download', job: job.name), rel: 'nofollow' do
+ = link_to latest_succeeded_namespace_project_artifacts_path(project.namespace, project, ref, 'download', job: job.name), rel: 'nofollow' do
%span Download '#{job.name}'
diff --git a/config/routes.rb b/config/routes.rb
index 70bdb1d5beb..da10c5609f6 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -765,9 +765,10 @@ Rails.application.routes.draw do
resources :artifacts, only: [] do
collection do
- get :search, path: ':ref_name/*path',
- format: false,
- constraints: { ref_name: /.+/ } # could have /
+ get :latest_succeeded,
+ path: ':ref_name/*path',
+ format: false,
+ constraints: { ref_name: /.+/ } # could have /
end
end
end