diff --git a/app/views/posts/show.html.erb b/app/views/posts/show.html.erb index 1d4addaa2..6d10371a2 100644 --- a/app/views/posts/show.html.erb +++ b/app/views/posts/show.html.erb @@ -147,8 +147,12 @@
  • <%= link_to "Move favorites", confirm_move_favorites_moderator_post_post_path(post_id: @post.id) %>
  • <% end %> - <% 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?" %>
  • + <% if @post.is_approvable? %> + <% if @post.is_deleted? %> +
  • <%= 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?" %>
  • + <% else %> +
  • <%= link_to "Approve", post_approvals_path(post_id: @post.id), remote: true, method: :post, "data-shortcut": "shift+o", "data-confirm": "Are you sure you want to approve this post?" %>
  • + <% end %> <% elsif !@post.is_deleted? && policy(@post).delete? %>
  • <%= link_to "Delete", @post, method: :delete, remote: true %>
  • <% end %>