Merge pull request #2965 from evazion/fix-confirm-approve

Add confirm dialog to sidebar approve/undelete links.
This commit is contained in:
Albert Yi
2017-04-10 14:29:24 -07:00
committed by GitHub

View File

@@ -31,7 +31,7 @@
<% if CurrentUser.can_approve_posts? %>
<% if post.is_deleted? %>
<li><%= link_to "Undelete", undelete_moderator_post_post_path(:post_id => post.id), :remote => true, :method => :post, :id => "undelete" %></li>
<li><%= link_to "Undelete", undelete_moderator_post_post_path(:post_id => post.id), :remote => true, :method => :post, :id => "undelete", :data => { :confirm => "Are you sure you want to undelete this post?" } %></li>
<% if post.fav_count > 0 && post.parent_id %>
<li><%= link_to "Move favorites", confirm_move_favorites_moderator_post_post_path(:post_id => post.id) %></li>
<% end %>
@@ -40,7 +40,7 @@
<% end %>
<% if post.is_flagged? || post.is_pending? %>
<li><%= link_to "Approve", moderator_post_approval_path(:post_id => post.id), :remote => true, :method => :post, :id => "approve" %></li>
<li><%= link_to "Approve", moderator_post_approval_path(:post_id => post.id), :remote => true, :method => :post, :id => "approve", :data => { :confirm => "Are you sure you want to approve this post?" } %></li>
<% else %>
<li><%= link_to "Hide from queue", moderator_post_disapproval_path(:post_id => post.id), :remote => true, :method => :post, :id => "disapprove" %></li>
<% end %>