From 6937c40747597748fd2799fd974184af65f2dc62 Mon Sep 17 00:00:00 2001 From: evazion Date: Mon, 4 May 2020 01:55:45 -0500 Subject: [PATCH] posts/index: update pending BUR notice criteria. * Only show pending BUR notice on first page. * Show pending BUR notice for all searches that include a single tag. --- app/logical/post_sets/post.rb | 4 ++-- app/views/posts/partials/index/_posts.html.erb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/logical/post_sets/post.rb b/app/logical/post_sets/post.rb index 3fe2d2760..efeac657f 100644 --- a/app/logical/post_sets/post.rb +++ b/app/logical/post_sets/post.rb @@ -132,8 +132,8 @@ module PostSets end def pending_bulk_update_requests - return BulkUpdateRequest.none unless query.is_simple_tag? - @pending_bulk_update_requests ||= BulkUpdateRequest.pending.where_array_includes_any(:tags, query.tags.first.name) + return BulkUpdateRequest.none unless tag.present? + @pending_bulk_update_requests ||= BulkUpdateRequest.pending.where_array_includes_any(:tags, tag.name) end end end diff --git a/app/views/posts/partials/index/_posts.html.erb b/app/views/posts/partials/index/_posts.html.erb index cbb347c54..759007c15 100644 --- a/app/views/posts/partials/index/_posts.html.erb +++ b/app/views/posts/partials/index/_posts.html.erb @@ -19,7 +19,7 @@ <% end %> - <% if CurrentUser.user.is_member? && post_set.query.is_simple_tag? %> + <% if CurrentUser.user.is_member? && post_set.tag.present? && post_set.current_page == 1 %> <% cache("tag-change-notice:#{post_set.query.normalize_query}", expires_in: 4.hours) do %> <% if post_set.pending_bulk_update_requests.present? %>