posts: rework post deletion to use dialog box.

Rework post deletion from using a separate page to using a dialog box,
like flagging.

* Add `DELETE /posts/:id` endpoint.
* Remove `POST /moderator/post/posts/:id/delete` endpoint.
This commit is contained in:
evazion
2020-08-03 19:28:10 -05:00
parent f1b0e31923
commit bca1f122d0
10 changed files with 69 additions and 62 deletions

View File

@@ -1,26 +0,0 @@
<h1>Delete Post</h1>
<div>
<%= PostPresenter.preview(@post, show_deleted: true) %>
</div>
<%= form_tag(delete_moderator_post_post_path, :style => "clear: both;", :class => "simple_form") do %>
<% if @post.parent_id %>
<div class="input">
<label for="move_favorites">
<%= check_box_tag "move_favorites" %>
Move favorites to parent?
</label>
</div>
<% end %>
<p style="font-weight: bold;">Note: If the reason you are planning to delete this post is because it is from a banned artist, please <%= link_to "ban", confirm_ban_moderator_post_post_path(@post) %> this post instead of deleting it.</p>
<div class="input">
<label for="reason">Reason</label>
<%= text_area_tag "reason" %>
</div>
<%= submit_tag "Delete" %>
<%= submit_tag "Cancel" %>
<% end %>