From b4a67331ce845c44e4b69b1b45e08c1e8f9b40bd Mon Sep 17 00:00:00 2001 From: evazion Date: Wed, 5 Oct 2022 01:25:26 -0500 Subject: [PATCH] posts: remove sidebar for banned searches. --- app/logical/post_sets/post.rb | 5 ++++- app/views/posts/index.html.erb | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/logical/post_sets/post.rb b/app/logical/post_sets/post.rb index d17225707..355be2c32 100644 --- a/app/logical/post_sets/post.rb +++ b/app/logical/post_sets/post.rb @@ -112,6 +112,7 @@ module PostSets # @return [Integer, nil] The number of posts returned by the search, or nil if unknown. def post_count + return 0 if artist.present? && artist.is_banned? && !current_user.is_approver? normalized_query.post_count end @@ -161,7 +162,9 @@ module PostSets concerning :TagListMethods do def related_tags - if normalized_query.wildcards.one? && normalized_query.tags.none? + if artist.present? && artist.is_banned? && !current_user.is_approver? + [] + elsif normalized_query.wildcards.one? && normalized_query.tags.none? wildcard_tags elsif normalized_query.is_metatag?(:search) saved_search_tags diff --git a/app/views/posts/index.html.erb b/app/views/posts/index.html.erb index 20f59c30c..1adc37818 100644 --- a/app/views/posts/index.html.erb +++ b/app/views/posts/index.html.erb @@ -105,7 +105,7 @@