Fix the 'no more topics' message for categories with non-ascii names

This commit is contained in:
Neil Lalonde 2013-05-15 11:44:45 -04:00
parent 18634ad00d
commit ae78954fc0

View File

@ -9,8 +9,7 @@
**/ **/
Discourse.ListTopicsView = Discourse.View.extend(Discourse.Scrolling, { Discourse.ListTopicsView = Discourse.View.extend(Discourse.Scrolling, {
templateName: 'list/topics', templateName: 'list/topics',
categoryBinding: 'Discourse.router.listController.category', categoryBinding: 'controller.controllers.list.category',
filterModeBinding: 'Discourse.router.listController.filterMode',
canCreateTopicBinding: 'controller.controllers.list.canCreateTopic', canCreateTopicBinding: 'controller.controllers.list.canCreateTopic',
loadedMore: false, loadedMore: false,
currentTopicId: null, currentTopicId: null,
@ -89,23 +88,28 @@ Discourse.ListTopicsView = Discourse.View.extend(Discourse.Scrolling, {
return (_ref = this.get('eyeline')) ? _ref.update() : void 0; return (_ref = this.get('eyeline')) ? _ref.update() : void 0;
}, },
footerMessage: (function() { footerMessage: function() {
var content, split; var content, split;
if (!this.get('allLoaded')) { if (!this.get('allLoaded')) {
return; return;
} }
content = this.get('controller.content'); content = this.get('category');
split = content.get('filter').split('/'); if( content ) {
if (content.get('topics.length') === 0) { return Em.String.i18n('topics.bottom.category', {category: content.get('name')});
return Em.String.i18n("topics.none." + split[0], {
category: split[1]
});
} else { } else {
return Em.String.i18n("topics.bottom." + split[0], { content = this.get('controller.content');
category: split[1] split = content.get('filter').split('/');
}); if (content.get('topics.length') === 0) {
return Em.String.i18n("topics.none." + split[0], {
category: split[1]
});
} else {
return Em.String.i18n("topics.bottom." + split[0], {
category: split[1]
});
}
} }
}).property('allLoaded', 'controller.content.topics.length') }.property('allLoaded', 'controller.content.topics.length')
}); });