diff --git a/app/assets/javascripts/discourse/components/category-chooser.js.es6 b/app/assets/javascripts/discourse/components/category-chooser.js.es6 index ed2b8a55e..856bcb4d1 100644 --- a/app/assets/javascripts/discourse/components/category-chooser.js.es6 +++ b/app/assets/javascripts/discourse/components/category-chooser.js.es6 @@ -26,7 +26,11 @@ export default ComboboxView.extend({ }.property('scopedCategoryId', 'categories'), _setCategories: function() { - this.set('categories', this.get('categories') || Discourse.Category.list()); + this.set('categories', this.get('categories') || ( + Discourse.SiteSettings.fixed_category_positions_on_create ? + Discourse.Category.list() : Discourse.Category.listByActivity() + ) + ); }.on('init'), none: function() { diff --git a/app/assets/javascripts/discourse/models/category.js b/app/assets/javascripts/discourse/models/category.js index 4f8ede69e..8deb5cb0c 100644 --- a/app/assets/javascripts/discourse/models/category.js +++ b/app/assets/javascripts/discourse/models/category.js @@ -216,6 +216,14 @@ Discourse.Category.reopenClass({ }, list: function() { + if (Discourse.SiteSettings.fixed_category_positions) { + return Discourse.Site.currentProp('categories'); + } else { + return Discourse.Site.currentProp('sortedCategories'); + } + }, + + listByActivity: function() { return Discourse.Site.currentProp('sortedCategories'); }, diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 73ec8e4c5..5206eb38d 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -768,6 +768,7 @@ en: category_featured_topics: "Number of topics displayed per category on the /categories page. After changing this value, it takes up to 15 minutes for the categories page to update." show_subcategory_list: "Show subcategory list instead of topic list when entering a category." fixed_category_positions: "If checked, you will be able to arrange categories into a fixed order. If unchecked, categories are listed in order of activity." + fixed_category_positions_on_create: "If checked, category ordering will be maintained on topic creation dialog (requires fixed_category_positions)." add_rel_nofollow_to_user_content: "Add rel nofollow to all submitted user content, except for internal links (including parent domains). If you change this, you must rebake all posts with: \"rake posts:rebake\"" exclude_rel_nofollow_domains: "A list of domains where nofollow should not be added to links. tld.com will automatically allow sub.tld.com as well. As a minimum, you should add the top-level domain of this site to help web crawlers find all content. If other parts of your website are at other domains, add those too." diff --git a/config/site_settings.yml b/config/site_settings.yml index c1c79722f..7f21b1a2c 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -168,6 +168,11 @@ basic: fixed_category_positions: client: true default: false + + fixed_category_positions_on_create: + client: true + default: false + show_subcategory_list: default: false client: true