Commit f86a5077 authored by Lin Jen-Shin's avatar Lin Jen-Shin
parent 11f840bf
......@@ -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)
......
......@@ -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)
......
......@@ -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}'
......@@ -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}'
......@@ -765,7 +765,8 @@ Rails.application.routes.draw do
resources :artifacts, only: [] do
collection do
get :search, path: ':ref_name/*path',
get :latest_succeeded,
path: ':ref_name/*path',
format: false,
constraints: { ref_name: /.+/ } # could have /
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment