posts: remove sidebar for banned searches.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
</div>
|
||||
|
||||
<div id="excerpt" style="display: none;">
|
||||
<% if @post_set.artist.present? && @post_set.artist.is_banned? && !policy(@post_set.artist).can_view_banned? %>
|
||||
<% if @post_set.artist.present? && @post_set.artist.is_banned? && !CurrentUser.user.is_approver? %>
|
||||
<p>The artist requested removal of this page.</p>
|
||||
<% elsif @post_set.artist.present? %>
|
||||
<%= render "artists/summary", artist: @post_set.artist %>
|
||||
@@ -172,8 +172,8 @@
|
||||
<% gallery.footer do %>
|
||||
<% if @post_set.hidden_posts.present? %>
|
||||
<div class="fineprint hidden-posts-notice">
|
||||
<% if @post_set.banned_posts.present? %>
|
||||
<%= @post_set.banned_posts.size %> post(s) were removed from this page at the artist's request (<%= link_to_wiki "learn more", "banned_artist" %>).<br>
|
||||
<% if @post_set.banned_posts.size == @post_set.posts.size %>
|
||||
This page was removed from this page at the artist's request (<%= link_to_wiki "learn more", "banned_artist" %>).<br>
|
||||
<% end %>
|
||||
|
||||
<% if @post_set.censored_posts.present? %>
|
||||
|
||||
Reference in New Issue
Block a user