FIX: Categories are ordered by topic_count.

This commit is contained in:
Robin Ward
2014-01-09 13:05:05 -05:00
parent eba54653c3
commit b28a8e262f
3 changed files with 8 additions and 4 deletions

View File

@@ -195,7 +195,7 @@ Discourse.Category.reopenClass({
},
list: function() {
return Discourse.Site.currentProp('categories');
return Discourse.Site.currentProp('sortedCategories');
},
findSingleBySlug: function(slug) {

View File

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