Project

General

Profile

Patch #19005 » add_search_results_per_page_option.diff

patch - Go MAEDA, 2015-02-03 05:08

View differences:

app/controllers/search_controller.rb (working copy)
66 66
      @result_count_by_type = fetcher.result_count_by_type
67 67
      @tokens = fetcher.tokens
68 68

  
69
      @result_pages = Paginator.new @result_count, 10, params['page']
69
      per_page = Setting.search_results_per_page.to_i
70
      per_page = 10 if per_page == 0
71
      @result_pages = Paginator.new @result_count, per_page, params['page']
70 72
      @results = fetcher.results(@result_pages.offset, @result_pages.per_page)
71 73
    else
72 74
      @question = ""
app/views/settings/_general.html.erb (working copy)
11 11
<p><%= setting_text_field :per_page_options, :size => 20 %>
12 12
<em class="info"><%= l(:text_comma_separated) %></em></p>
13 13

  
14
<p><%= setting_text_field :search_results_per_page, :size => 6 %>
15

  
14 16
<p><%= setting_text_field :activity_days_default, :size => 6 %> <%= l(:label_day_plural) %></p>
15 17

  
16 18
<p><%= setting_text_field :host_name, :size => 60 %>
config/locales/en.yml (working copy)
415 415
  setting_force_default_language_for_loggedin: Force default language for logged-in users
416 416
  setting_link_copied_issue: Link issues on copy
417 417
  setting_max_additional_emails: Maximum number of additional email addresses
418
  setting_search_results_per_page: Search results per page
418 419

  
419 420
  permission_add_project: Create project
420 421
  permission_add_subprojects: Create subprojects
config/settings.yml (working copy)
59 59
  default: 30
60 60
per_page_options:
61 61
  default: '25,50,100'
62
search_results_per_page:
63
  default: 10
62 64
mail_from:
63 65
  default: redmine@example.net
64 66
bcc_recipients:
(1-1/3)