FIX: top_menu with category links like category/Meta are not case sensitive

This commit is contained in:
Neil Lalonde 2014-08-15 17:42:00 -04:00
parent 49f0eaea13
commit 6c10cc3788
2 changed files with 5 additions and 1 deletions

View File

@ -29,6 +29,10 @@ Discourse.Category = Discourse.Model.extend({
return Discourse.getURL("/category/") + Discourse.Category.slugFor(this);
}.property('name'),
nameLower: function() {
return this.get('name').toLowerCase();
}.property('name'),
unreadUrl: function() {
return this.get('url') + '/l/unread';
}.property('url'),

View File

@ -21,7 +21,7 @@ Discourse.NavItem = Discourse.Model.extend({
categorySlug: function() {
var split = this.get('name').split('/');
if (split[0] === 'category' && split[1]) {
var cat = Discourse.Site.current().categories.findProperty('name', split[1]);
var cat = Discourse.Site.current().categories.findProperty('nameLower', split[1].toLowerCase());
return cat ? Discourse.Category.slugFor(cat) : null;
}
return null;