From dff0b0e48b62ff7ed91c3843a0756e991a093eaa Mon Sep 17 00:00:00 2001 From: evazion Date: Mon, 18 Apr 2022 02:06:14 -0500 Subject: [PATCH] posts: add back option to undelete posts in sidebar. This was removed in 1a990d5ab, but that left no way to undelete posts that haven't been appealed since the quickmod bar isn't shown in that case. --- app/views/posts/show.html.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/posts/show.html.erb b/app/views/posts/show.html.erb index 4a7e9aa1d..fdb17ab93 100644 --- a/app/views/posts/show.html.erb +++ b/app/views/posts/show.html.erb @@ -147,7 +147,9 @@
  • <%= link_to "Move favorites", confirm_move_favorites_moderator_post_post_path(post_id: @post.id) %>
  • <% end %> - <% if !@post.is_deleted? && policy(@post).delete? %> + <% if @post.is_deleted? && @post.is_approvable? %> +
  • <%= link_to "Undelete", post_approvals_path(post_id: @post.id), remote: true, method: :post, "data-shortcut": "shift+o", "data-confirm": "Are you sure you want to undelete this post?" %>
  • + <% elsif !@post.is_deleted? && policy(@post).delete? %>
  • <%= link_to "Delete", @post, method: :delete, remote: true %>
  • <% end %>