FIX: maintain category ordering when position is fixed for browsing

FEATURE: allow mods to set category ordering for topic creation dialog
  using fixed_category_positions_on_create
This commit is contained in:
Sam 2015-06-16 09:31:41 +10:00
parent 357d4e3dd3
commit 7b8786e14f
4 changed files with 19 additions and 1 deletions

View File

@ -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() {

View File

@ -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');
},

View File

@ -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."

View File

@ -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