From 8cabc140998455ac95afa50f19720ea39798a3aa Mon Sep 17 00:00:00 2001 From: cpradio Date: Tue, 6 Oct 2015 12:04:31 -0400 Subject: [PATCH] FEATURE: Allow default period to be set for Top Page --- app/controllers/list_controller.rb | 2 +- config/locales/server.en.yml | 1 + config/site_settings.yml | 10 ++++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/controllers/list_controller.rb b/app/controllers/list_controller.rb index 844bc6ba6df..f3f1eadc514 100644 --- a/app/controllers/list_controller.rb +++ b/app/controllers/list_controller.rb @@ -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) diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 9479bd662d5..0550f303e76 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -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." diff --git a/config/site_settings.yml b/config/site_settings.yml index 91a7d07d6d7..20addc4b4a0 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -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