From 158306f2f4f6c39672b56b8e45f243e19f4fd7ab Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Wed, 15 Jan 2014 15:20:07 -0500 Subject: [PATCH] Don't show uncategorized in hamburger menu if it's empty, unless you're staff --- .../discourse/controllers/site_map_controller.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/controllers/site_map_controller.js b/app/assets/javascripts/discourse/controllers/site_map_controller.js index f8ca13fc068..01032113862 100644 --- a/app/assets/javascripts/discourse/controllers/site_map_controller.js +++ b/app/assets/javascripts/discourse/controllers/site_map_controller.js @@ -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: {