stub in preview for bulk revert

This commit is contained in:
Albert Yi
2016-11-01 16:47:46 -07:00
parent 91793fff82
commit 4e48e80e1f
6 changed files with 196 additions and 8 deletions

View File

@@ -0,0 +1,24 @@
module Moderator
class BulkRevertsController < ApplicationController
before_filter :moderator_only
helper PostVersionsHelper
def new
@constraints = params[:constraints] || {}
end
def create
@constraints = params[:constraints] || {}
@bulk_revert = BulkRevert.new(@constraints)
if params[:commit] == "Test"
@bulk_revert.preview
render action: "new"
else
@bulk_revert.process!
flash[:notice] = "Reverts queued"
redirect_to new_bulk_revert_path
end
end
end
end