summaryrefslogtreecommitdiffstats
path: root/app/controllers/wiki_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-10-23 18:45:14 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-10-23 18:45:14 +0000
commit6cccdce06eff37c51b0802ad2b85a71497084523 (patch)
tree45ff4588eca7da9fbc1f3de364eafa1ff128b672 /app/controllers/wiki_controller.rb
parent9e7f71080f9230656e8a6981d14576f4b3d40a79 (diff)
downloadredmine-6cccdce06eff37c51b0802ad2b85a71497084523.tar.gz
redmine-6cccdce06eff37c51b0802ad2b85a71497084523.zip
Ability to delete a version from a wiki page history (#10852).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10705 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/wiki_controller.rb')
-rw-r--r--app/controllers/wiki_controller.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb
index e9d060870..6e747ecda 100644
--- a/app/controllers/wiki_controller.rb
+++ b/app/controllers/wiki_controller.rb
@@ -35,7 +35,7 @@ class WikiController < ApplicationController
default_search_scope :wiki_pages
before_filter :find_wiki, :authorize
before_filter :find_existing_or_new_page, :only => [:show, :edit, :update]
- before_filter :find_existing_page, :only => [:rename, :protect, :history, :diff, :annotate, :add_attachment, :destroy]
+ before_filter :find_existing_page, :only => [:rename, :protect, :history, :diff, :annotate, :add_attachment, :destroy, :destroy_version]
helper :attachments
include AttachmentsHelper
@@ -237,6 +237,14 @@ class WikiController < ApplicationController
redirect_to :action => 'index', :project_id => @project
end
+ def destroy_version
+ return render_403 unless editable?
+
+ @content = @page.content_for_version(params[:version])
+ @content.destroy
+ redirect_to_referer_or :action => 'history', :id => @page.title, :project_id => @project
+ end
+
# Export wiki to a single pdf or html file
def export
@pages = @wiki.pages.all(:order => 'title', :include => [:content, :attachments], :limit => 75)