Files
danbooru/app/views/posts/partials/show/_notices.html.erb
evazion 366eff4169 posts: show only last successful flag on deleted posts.
In the "This post was deleted" notice, show only the last successful
flag, instead of all previous flags (which may include rejected flags).
2020-08-16 17:19:29 -05:00

61 lines
2.6 KiB
Plaintext

<% if post.is_banned? %>
<div class="notice notice-small post-notice post-notice-banned">
The artist requested removal of this page
</div>
<% end %>
<% if post.in_modqueue? %>
<div class="notice notice-small post-notice post-notice-pending">
<% if post.is_pending? %>
This post is pending approval. (<%= link_to_wiki "learn more", "about:mod_queue" %>)
<% elsif post.is_flagged? %>
This post was flagged and is pending approval (<%= link_to_wiki "learn more", "howto:flag" %>)
<%= render "post_flags/reasons", flag: post.flags.select(&:pending?).last %>
<% elsif post.is_appealed? %>
This post was appealed and is pending approval (<%= link_to_wiki "learn more", "about:mod_queue" %>)
<%= render "post_appeals/reasons", appeal: post.appeals.select(&:pending?).last %>
<% end %>
<%= render "post_disapprovals/counts", :disapprovals => post.disapprovals, :post => post %>
<% if policy(PostDisapproval).create? && !post.disapproved_by?(CurrentUser.user) %>
<%= render "modqueue/quick_mod", post: post %>
<%= render "post_disapprovals/detailed_rejection_dialog" %>
<% end %>
</div>
<% elsif post.is_deleted? %>
<div class="notice notice-small post-notice post-notice-deleted">
<% if post.flags.succeeded.last.present? %>
<p>This post was deleted for the following reason: </p>
<%= render "post_flags/reasons", flag: post.flags.succeeded.last %>
<% else %>
<p>This post was deleted</p>
<% end %>
<%= render "post_disapprovals/counts", :disapprovals => post.disapprovals, :post => post %>
<% if CurrentUser.id == post.uploader_id %>
<p>If you don't understand why your upload was deleted, you can ask for
advice in the Upload Feedback Thread on the forum.</p>
<% end %>
</div>
<% end %>
<% if post.parent.present? %>
<div class="notice notice-small post-notice post-notice-child">
<%= render "posts/partials/show/parent_notice", parent: post.parent, children: @sibling_posts.to_a %>
</div>
<% end %>
<% if post.has_visible_children? %>
<div class="notice notice-small post-notice post-notice-parent">
<%= render "posts/partials/show/child_notice", parent: post, children: @child_posts.to_a %>
</div>
<% end %>
<% if policy(post).visible? && post.has_large? && !post.is_ugoira? && post.resize_percentage.floor < 100 %>
<div class="notice notice-small post-notice post-notice-resized" id="image-resize-notice">
Resized to <%= number_to_percentage post.resize_percentage.floor, precision: 0 %> of original (<%= link_to "view original", post.tagged_file_url, class: "image-view-original-link" %>)
</div>
<% end %>