delete action from post/show requires confirmation+flag reason now
This commit is contained in:
@@ -3,10 +3,18 @@ module Moderator
|
||||
class PostsController < ApplicationController
|
||||
before_filter :janitor_only, :only => [:delete, :undelete]
|
||||
before_filter :admin_only, :only => [:annihilate]
|
||||
|
||||
def confirm_delete
|
||||
@post = ::Post.find(params[:id])
|
||||
end
|
||||
|
||||
def delete
|
||||
@post = ::Post.find(params[:id])
|
||||
@post.delete!
|
||||
if params[:commit] == "Delete"
|
||||
@post.flag!(params[:reason])
|
||||
@post.delete!
|
||||
end
|
||||
redirect_to(post_path(@post))
|
||||
end
|
||||
|
||||
def undelete
|
||||
|
||||
Reference in New Issue
Block a user