FEATURE: Allow default period to be set for Top Page

This commit is contained in:
cpradio 2015-10-06 12:04:31 -04:00
parent af7d51e923
commit 8cabc14099
3 changed files with 12 additions and 1 deletions

View File

@ -295,7 +295,7 @@ class ListController < ApplicationController
return period if top_topics.count >= SiteSetting.topics_per_period_in_top_page
end
# default period is yearly
:yearly
SiteSetting.top_page_default_timeframe
end
def self.best_periods_for(date)

View File

@ -891,6 +891,7 @@ en:
topics_per_period_in_top_summary: "Number of top topics shown in the default top topics summary."
topics_per_period_in_top_page: "Number of top topics shown on the expanded 'Show More' top topics."
redirect_users_to_top_page: "Automatically redirect new and long absent users to the top page."
top_page_default_timeframe: "Default timeframe for the top view page."
show_email_on_profile: "Show a user's email on their profile (only visible to themselves and staff)"
email_token_valid_hours: "Forgot password / activate account tokens are valid for (n) hours."

View File

@ -164,6 +164,16 @@ basic:
topics_per_period_in_top_page:
default: 50
min: 1
top_page_default_timeframe:
default: 'yearly'
type: enum
choices:
- all
- yearly
- quarterly
- monthly
- weekly
- daily
category_featured_topics:
client: true
default: 3