Don't show uncategorized in hamburger menu if it's empty, unless you're staff
This commit is contained in:
parent
89908cdb47
commit
158306f2f4
|
@ -22,7 +22,14 @@ Discourse.SiteMapController = Ember.ArrayController.extend(Discourse.HasCurrentU
|
||||||
}.property(),
|
}.property(),
|
||||||
|
|
||||||
categories: function() {
|
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(),
|
}.property(),
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
Loading…
Reference in New Issue