From 6595a9f87ed9db307b47e112cdae2668d174cdc4 Mon Sep 17 00:00:00 2001 From: evazion Date: Sun, 8 Sep 2019 23:34:49 -0500 Subject: [PATCH] users: raise max posts per page to 200. --- app/models/user.rb | 2 +- app/views/users/edit.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index c98f32a26..f9fe2fffe 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -73,7 +73,7 @@ class User < ApplicationRecord validates_uniqueness_of :email, :case_sensitive => false, :if => ->(rec) { rec.email.present? && rec.saved_change_to_email? } validates_length_of :password, :minimum => 5, :if => ->(rec) { rec.new_record? || rec.password.present?} validates_inclusion_of :default_image_size, :in => %w(large original) - validates_inclusion_of :per_page, :in => 1..100 + validates_inclusion_of :per_page, in: (1..PostSets::Post::MAX_PER_PAGE) validates_confirmation_of :password validates_presence_of :comment_threshold validate :validate_ip_addr_is_not_banned, :on => :create diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index 9aebace7a..5df373ea5 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -37,7 +37,7 @@ <%= f.input :default_image_size, :hint => "Show original image or show resized #{Danbooru.config.large_image_width} pixel version", :label => "Default image width", :collection => [["850px", "large"], ["original", "original"]], :include_blank => false %> <% if CurrentUser.user.is_gold? %> - <%= f.input :per_page, :label => "Posts per page", :as => :select, :hint => "Number of thumbnails per page", :collection => (1..200), :include_blank => false %> + <%= f.input :per_page, :label => "Posts per page", :as => :select, :hint => "Number of thumbnails per page", :collection => (1..PostSets::Post::MAX_PER_PAGE), :include_blank => false %> <% end %> <%= f.input :enable_safe_mode, :label => "Safe mode", :hint => "Show only safe images. Hide questionable and explicit images.", :as => :select, :include_blank => false, :collection => [["Yes", "true"], ["No", "false"]] %>