diff options
-rw-r--r-- | app/helpers/search_helper.rb | 7 | ||||
-rw-r--r-- | app/views/search/_results.html.haml | 2 | ||||
-rw-r--r-- | app/views/search/results/_blob.html.haml | 2 | ||||
-rw-r--r-- | app/views/search/results/_wiki_blob.html.haml | 2 |
4 files changed, 10 insertions, 3 deletions
diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb index 8110377850b..09165979b26 100644 --- a/app/helpers/search_helper.rb +++ b/app/helpers/search_helper.rb @@ -33,10 +33,15 @@ module SearchHelper "Showing #{from} - #{to} of #{count} #{scope.humanize(capitalize: false)} for \"#{term}\"" end - def find_project_for_result_blob(result) + def find_project_for_result_blob(projects, result) @project end + # Used in EE + def blob_projects(results) + nil + end + def parse_search_result(result) result end diff --git a/app/views/search/_results.html.haml b/app/views/search/_results.html.haml index 2e62039b90a..5b25a67bc87 100644 --- a/app/views/search/_results.html.haml +++ b/app/views/search/_results.html.haml @@ -21,6 +21,8 @@ - if @scope == 'projects' .term = render 'shared/projects/list', projects: @search_objects, pipeline_status: false + - elsif %w[blobs wiki_blobs].include?(@scope) + = render partial: 'search/results/blob', collection: @search_objects, locals: { projects: blob_projects(@search_objects) } - else = render partial: "search/results/#{@scope.singularize}", collection: @search_objects diff --git a/app/views/search/results/_blob.html.haml b/app/views/search/results/_blob.html.haml index 2a602095845..bdad07f36d1 100644 --- a/app/views/search/results/_blob.html.haml +++ b/app/views/search/results/_blob.html.haml @@ -1,4 +1,4 @@ -- project = find_project_for_result_blob(blob) +- project = find_project_for_result_blob(projects, blob) - return unless project - blob = parse_search_result(blob) diff --git a/app/views/search/results/_wiki_blob.html.haml b/app/views/search/results/_wiki_blob.html.haml index 389e4cc75b9..b351ecd4edf 100644 --- a/app/views/search/results/_wiki_blob.html.haml +++ b/app/views/search/results/_wiki_blob.html.haml @@ -1,4 +1,4 @@ -- project = find_project_for_result_blob(wiki_blob) +- project = find_project_for_result_blob(projects, wiki_blob) - wiki_blob = parse_search_result(wiki_blob) - wiki_blob_link = project_wiki_path(project, wiki_blob.basename) |