Merge branch 'master' into vdom

This commit is contained in:
Sam 2016-02-19 17:03:42 +11:00
commit f33cfb698c

View File

@ -145,15 +145,9 @@ class CategoryList
end
# Remove any empty categories unless we can create them (so we can see the controls)
def prune_empty
if !@guardian.can_create?(Category)
# Remove categories with no featured topics unless we have the ability to edit one
@categories.delete_if do |c|
c.displayable_topics.blank? && c.description.blank?
end
elsif !SiteSetting.allow_uncategorized_topics
# Don't show uncategorized to admins either, if uncategorized topics are not allowed
if @guardian.can_create?(Category) && !SiteSetting.allow_uncategorized_topics
# HACK: Don't show uncategorized to admins either, if uncategorized topics are not allowed
# and there are none.
@categories.delete_if do |c|
c.uncategorized? && c.displayable_topics.blank?