mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 02:40:53 -06:00
FEATURE: stop removing empty categories users have access to from /categories page
This is particularly important for heirarchies of categories where a parent is empty Also, if we hide the blank category, how are we going to create the first topic? Old behavior was hacky.
This commit is contained in:
parent
ab06f86fbe
commit
c230c11707
@ -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?
|
||||
|
Loading…
Reference in New Issue
Block a user