summaryrefslogtreecommitdiffstats
path: root/app/controllers/search_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-02-07 07:44:44 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-02-07 07:44:44 +0000
commit756eaeffb4d1b9fe14f9948b37589cfb97573c3a (patch)
tree0d414a2aa486fb71034b8edc9d386aa803519e9f /app/controllers/search_controller.rb
parentd1ad182192afe16eecf78361aa2bc0c8de3b0663 (diff)
downloadredmine-756eaeffb4d1b9fe14f9948b37589cfb97573c3a.tar.gz
redmine-756eaeffb4d1b9fe14f9948b37589cfb97573c3a.zip
Make search results per page configurable (#19005).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@13962 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/search_controller.rb')
-rw-r--r--app/controllers/search_controller.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb
index a58092564..9bc9926bc 100644
--- a/app/controllers/search_controller.rb
+++ b/app/controllers/search_controller.rb
@@ -66,7 +66,9 @@ class SearchController < ApplicationController
@result_count_by_type = fetcher.result_count_by_type
@tokens = fetcher.tokens
- @result_pages = Paginator.new @result_count, 10, params['page']
+ per_page = Setting.search_results_per_page.to_i
+ per_page = 10 if per_page == 0
+ @result_pages = Paginator.new @result_count, per_page, params['page']
@results = fetcher.results(@result_pages.offset, @result_pages.per_page)
else
@question = ""