Skip to content

Commit

Permalink
Don't show uncategorized in hamburger menu if it's empty, unless you'…
Browse files Browse the repository at this point in the history
…re staff
  • Loading branch information
nlalonde committed Jan 15, 2014
1 parent 89908cd commit 158306f
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,14 @@ Discourse.SiteMapController = Ember.ArrayController.extend(Discourse.HasCurrentU
}.property(),

categories: function() {
return Discourse.Category.list();
if (Discourse.SiteSettings.allow_uncategorized_topics) {
return Discourse.Category.list();
} else {
// Exclude the uncategorized category if it's empty
return Discourse.Category.list().reject(function(c) {
return c.get('isUncategorizedCategory') && !Discourse.User.currentProp('staff');
});
}
}.property(),

actions: {
Expand Down

0 comments on commit 158306f

Please sign in to comment.