summaryrefslogtreecommitdiff
path: root/app/controllers/search_controller.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-04-28 12:48:42 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-04-28 12:48:42 +0300
commitd5fe1e57d5107c5ddc57feee5c3d1f7ed03941ab (patch)
treef28bf0e8b04bb16699ef2952c82958ed5933dd9f /app/controllers/search_controller.rb
parent8140c6828905345ea510b23ee09e53f01a74f97d (diff)
downloadgitlab-ce-d5fe1e57d5107c5ddc57feee5c3d1f7ed03941ab.tar.gz
Draft improvements to search layout
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/controllers/search_controller.rb')
-rw-r--r--app/controllers/search_controller.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb
index c5828d0b2df..ad9e9e8487e 100644
--- a/app/controllers/search_controller.rb
+++ b/app/controllers/search_controller.rb
@@ -4,20 +4,22 @@ class SearchController < ApplicationController
def show
return if params[:search].nil? || params[:search].blank?
+ @search_term = params[:search]
+
if params[:project_id].present?
@project = Project.find_by(id: params[:project_id])
@project = nil unless can?(current_user, :download_code, @project)
end
if params[:group_id].present?
- @group = Group.find_by(id: params[:group_id])
+ @group = Group.find_by(id: params[:group_id])
@group = nil unless can?(current_user, :read_group, @group)
end
-
+
@scope = params[:scope]
@show_snippets = params[:snippets].eql? 'true'
- @search_results =
+ @search_results =
if @project
unless %w(blobs notes issues merge_requests wiki_blobs).
include?(@scope)
@@ -37,6 +39,7 @@ class SearchController < ApplicationController
end
Search::GlobalService.new(current_user, params).execute
end
+
@objects = @search_results.objects(@scope, params[:page])
end