posts: don't show nsfw tags in sidebar in safe mode.

Fix the post index page to not show nsfw tags in the sidebar in safe
mode. Instead of showing the most popular tags on the front page, or the
most similar tags to the current search, show only frequent tags (the
top 25 tags from posts on the current page).
This commit is contained in:
evazion
2022-05-17 03:59:01 -05:00
parent ce18c866d9
commit 06b38a19af

View File

@@ -161,13 +161,13 @@ module PostSets
concerning :TagListMethods do
def related_tags
if post_query.wildcards.one? && post_query.tags.none?
if normalized_query.wildcards.one? && normalized_query.tags.none?
wildcard_tags
elsif post_query.is_metatag?(:search)
elsif normalized_query.is_metatag?(:search)
saved_search_tags
elsif post_query.is_empty_search? || post_query.is_metatag?(:order, :rank)
elsif normalized_query.is_empty_search? || normalized_query.is_metatag?(:order, :rank)
popular_tags.presence || frequent_tags
elsif post_query.is_single_term?
elsif normalized_query.is_single_term?
similar_tags.presence || frequent_tags
else
frequent_tags