diff --git a/app/assets/javascripts/discourse/components/edit-category-settings.js.es6 b/app/assets/javascripts/discourse/components/edit-category-settings.js.es6 index 0d5336835ac..6a97b28ebe7 100644 --- a/app/assets/javascripts/discourse/components/edit-category-settings.js.es6 +++ b/app/assets/javascripts/discourse/components/edit-category-settings.js.es6 @@ -27,6 +27,13 @@ export default buildCategoryPanel('settings', { ]; }, + @computed + availableTopPeriods() { + return ['all', 'yearly', 'quarterly', 'monthly', 'weekly', 'daily'].map((p) => { + return {name: I18n.t(`filters.top.${p}.title`), value: p}; + }); + }, + @computed availableSorts() { return ['likes', 'op_likes', 'views', 'posts', 'activity', 'posters', 'category', 'created'] diff --git a/app/assets/javascripts/discourse/models/category.js.es6 b/app/assets/javascripts/discourse/models/category.js.es6 index 8550159ddd3..16304f453e6 100644 --- a/app/assets/javascripts/discourse/models/category.js.es6 +++ b/app/assets/javascripts/discourse/models/category.js.es6 @@ -106,7 +106,8 @@ const Category = RestModel.extend({ show_subcategory_list: this.get('show_subcategory_list'), num_featured_topics: this.get('num_featured_topics'), default_view: this.get('default_view'), - subcategory_list_style: this.get('subcategory_list_style') + subcategory_list_style: this.get('subcategory_list_style'), + default_top_period: this.get('default_top_period') }, type: id ? 'PUT' : 'POST' }); diff --git a/app/assets/javascripts/discourse/templates/components/edit-category-settings.hbs b/app/assets/javascripts/discourse/templates/components/edit-category-settings.hbs index e12846ea3c0..aae72706cd7 100644 --- a/app/assets/javascripts/discourse/templates/components/edit-category-settings.hbs +++ b/app/assets/javascripts/discourse/templates/components/edit-category-settings.hbs @@ -44,6 +44,13 @@ +
+ +
+