Move wiki page to other project (#5450).

git-svn-id: http://svn.redmine.org/redmine/trunk@13643 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2014-11-23 13:36:01 +00:00
parent 1ada789a6c
commit e0a034164f
11 changed files with 220 additions and 36 deletions

View File

@@ -198,9 +198,10 @@ class WikiController < ApplicationController
@page.redirect_existing_links = true
# used to display the *original* title if some AR validation errors occur
@original_title = @page.pretty_title
if request.post? && @page.update_attributes(params[:wiki_page])
@page.safe_attributes = params[:wiki_page]
if request.post? && @page.save
flash[:notice] = l(:notice_successful_update)
redirect_to project_wiki_page_path(@project, @page.title)
redirect_to project_wiki_page_path(@page.project, @page.title)
end
end
@@ -344,7 +345,11 @@ private
end
def redirect_to_page(page)
redirect_to :action => action_name, :project_id => page.wiki.project, :id => page.title
if page.project && page.project.visible?
redirect_to :action => action_name, :project_id => page.project, :id => page.title
else
render_404
end
end
# Returns true if the current user is allowed to edit the page, otherwise false