mirror of
https://github.com/redmine/redmine.git
synced 2025-12-16 05:20:28 +01:00
add empty line after guard clause to WikiController
git-svn-id: http://svn.redmine.org/redmine/trunk@20226 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -127,6 +127,7 @@ class WikiController < ApplicationController
|
|||||||
# edit an existing page or a new one
|
# edit an existing page or a new one
|
||||||
def edit
|
def edit
|
||||||
return render_403 unless editable?
|
return render_403 unless editable?
|
||||||
|
|
||||||
if @page.new_record?
|
if @page.new_record?
|
||||||
if params[:parent].present?
|
if params[:parent].present?
|
||||||
@page.parent = @page.wiki.find_page(params[:parent].to_s)
|
@page.parent = @page.wiki.find_page(params[:parent].to_s)
|
||||||
@@ -153,8 +154,8 @@ class WikiController < ApplicationController
|
|||||||
# Creates a new page or updates an existing one
|
# Creates a new page or updates an existing one
|
||||||
def update
|
def update
|
||||||
@page = @wiki.find_or_new_page(params[:id])
|
@page = @wiki.find_or_new_page(params[:id])
|
||||||
|
|
||||||
return render_403 unless editable?
|
return render_403 unless editable?
|
||||||
|
|
||||||
was_new_page = @page.new_record?
|
was_new_page = @page.new_record?
|
||||||
@page.safe_attributes = params[:wiki_page]
|
@page.safe_attributes = params[:wiki_page]
|
||||||
|
|
||||||
@@ -216,6 +217,7 @@ class WikiController < ApplicationController
|
|||||||
# rename a page
|
# rename a page
|
||||||
def rename
|
def rename
|
||||||
return render_403 unless editable?
|
return render_403 unless editable?
|
||||||
|
|
||||||
@page.redirect_existing_links = true
|
@page.redirect_existing_links = true
|
||||||
# used to display the *original* title if some AR validation errors occur
|
# used to display the *original* title if some AR validation errors occur
|
||||||
@original_title = @page.pretty_title
|
@original_title = @page.pretty_title
|
||||||
@@ -273,6 +275,7 @@ class WikiController < ApplicationController
|
|||||||
# Reassign children to another parent page
|
# Reassign children to another parent page
|
||||||
reassign_to = @wiki.pages.find_by_id(params[:reassign_to_id].to_i)
|
reassign_to = @wiki.pages.find_by_id(params[:reassign_to_id].to_i)
|
||||||
return unless reassign_to
|
return unless reassign_to
|
||||||
|
|
||||||
@page.children.each do |child|
|
@page.children.each do |child|
|
||||||
child.update_attribute(:parent, reassign_to)
|
child.update_attribute(:parent, reassign_to)
|
||||||
end
|
end
|
||||||
@@ -323,6 +326,7 @@ class WikiController < ApplicationController
|
|||||||
page = @wiki.find_page(params[:id])
|
page = @wiki.find_page(params[:id])
|
||||||
# page is nil when previewing a new page
|
# page is nil when previewing a new page
|
||||||
return render_403 unless page.nil? || editable?(page)
|
return render_403 unless page.nil? || editable?(page)
|
||||||
|
|
||||||
if page
|
if page
|
||||||
@attachments += page.attachments
|
@attachments += page.attachments
|
||||||
@previewed = page.content
|
@previewed = page.content
|
||||||
@@ -333,6 +337,7 @@ class WikiController < ApplicationController
|
|||||||
|
|
||||||
def add_attachment
|
def add_attachment
|
||||||
return render_403 unless editable?
|
return render_403 unless editable?
|
||||||
|
|
||||||
attachments = Attachment.attach_files(@page, params[:attachments])
|
attachments = Attachment.attach_files(@page, params[:attachments])
|
||||||
render_attachment_warning_if_needed(@page)
|
render_attachment_warning_if_needed(@page)
|
||||||
redirect_to :action => 'show', :id => @page.title, :project_id => @project
|
redirect_to :action => 'show', :id => @page.title, :project_id => @project
|
||||||
|
|||||||
Reference in New Issue
Block a user