mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Categories are ordered by topic_count.
This commit is contained in:
@@ -195,7 +195,7 @@ Discourse.Category.reopenClass({
|
||||
},
|
||||
|
||||
list: function() {
|
||||
return Discourse.Site.currentProp('categories');
|
||||
return Discourse.Site.currentProp('sortedCategories');
|
||||
},
|
||||
|
||||
findSingleBySlug: function(slug) {
|
||||
|
||||
@@ -22,6 +22,10 @@ Discourse.Site = Discourse.Model.extend({
|
||||
return postActionTypes.filterProperty('is_flag', true);
|
||||
}.property('post_action_types.@each'),
|
||||
|
||||
sortedCategories: Em.computed.sort('categories', function(a, b) {
|
||||
return (b.get('topic_count') || 0) - (a.get('topic_count') || 0);
|
||||
}),
|
||||
|
||||
postActionTypeById: function(id) {
|
||||
return this.get("postActionByIdLookup.action" + id);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user