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
This commit is contained in:
Jean-Philippe Lang
2015-02-07 07:44:44 +00:00
parent d1ad182192
commit 756eaeffb4
5 changed files with 9 additions and 1 deletions

View File

@@ -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 = ""