Fix #4178: add ability to mass undo tag edits.

Adds checkboxes to the /post_versions index allowing you to select and
undo multiple versions at once.
This commit is contained in:
evazion
2019-09-27 20:26:39 -05:00
parent 9000bc5cc6
commit d29bbbbd71
11 changed files with 150 additions and 34 deletions

View File

@@ -2,8 +2,10 @@ class PostVersionsController < ApplicationController
before_action :member_only, except: [:index, :search]
before_action :check_availabililty
respond_to :html, :xml, :json
respond_to :js, only: [:undo]
def index
# XXX statement timeouts
@post_versions = PostArchive.includes(:updater, post: [:versions]).search(search_params).paginate(params[:page], :limit => params[:limit], :search_count => params[:search])
respond_with(@post_versions)
end
@@ -13,14 +15,9 @@ class PostVersionsController < ApplicationController
def undo
@post_version = PostArchive.find(params[:id])
@post_version.undo!
if @post_version.post.visible?
@post_version.undo!
end
respond_with(@post_version) do |format|
format.js
end
respond_with(@post_version)
end
private