Use a site setting for maximum summary results

This commit is contained in:
Robin Ward 2014-10-28 16:03:43 -04:00
parent 3eb020c466
commit f47ab30b04
3 changed files with 4 additions and 1 deletions

View File

@ -240,7 +240,7 @@ class Post < ActiveRecord::Base
end end
def self.summary def self.summary
where(["(post_number = 1) or (percent_rank <= ?)", SiteSetting.summary_percent_filter.to_f / 100.0]).limit(100) where(["(post_number = 1) or (percent_rank <= ?)", SiteSetting.summary_percent_filter.to_f / 100.0]).limit(SiteSetting.summary_max_results)
end end
def update_flagged_posts_count def update_flagged_posts_count

View File

@ -695,6 +695,8 @@ en:
summary_posts_required: "Minimum posts in a topic before 'Summarize This Topic' is enabled" summary_posts_required: "Minimum posts in a topic before 'Summarize This Topic' is enabled"
summary_likes_required: "Minimum likes in a topic before 'Summarize This Topic' is enabled" summary_likes_required: "Minimum likes in a topic before 'Summarize This Topic' is enabled"
summary_percent_filter: "When a user clicks 'Summarize This Topic', show the top % of posts" summary_percent_filter: "When a user clicks 'Summarize This Topic', show the top % of posts"
summary_max_results: "Maximum posts returned by 'Summary This Topic'"
enable_private_messages: "Allow trust level 1 users to create private messages and reply to private messages" enable_private_messages: "Allow trust level 1 users to create private messages and reply to private messages"
enable_long_polling: "Message bus used for notification can use long polling" enable_long_polling: "Message bus used for notification can use long polling"

View File

@ -713,6 +713,7 @@ uncategorized:
summary_posts_required: 50 summary_posts_required: 50
summary_likes_required: 1 summary_likes_required: 1
summary_percent_filter: 20 summary_percent_filter: 20
summary_max_results: 100
# View heat thresholds # View heat thresholds
topic_views_heat_low: topic_views_heat_low: