mirror of
https://github.com/meineerde/redmine.git
synced 2026-03-04 16:23:06 +00:00
use "do end" instead of {} at WikiController
git-svn-id: http://svn.redmine.org/redmine/trunk@20290 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
14e3857f52
commit
8b4e4e76a4
@ -49,9 +49,9 @@ class WikiController < ApplicationController
|
|||||||
load_pages_for_index
|
load_pages_for_index
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html do
|
||||||
@pages_by_parent_id = @pages.group_by(&:parent_id)
|
@pages_by_parent_id = @pages.group_by(&:parent_id)
|
||||||
}
|
end
|
||||||
format.api
|
format.api
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -184,17 +184,17 @@ class WikiController < ApplicationController
|
|||||||
call_hook(:controller_wiki_edit_after_save, { :params => params, :page => @page})
|
call_hook(:controller_wiki_edit_after_save, { :params => params, :page => @page})
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html do
|
||||||
anchor = @section ? "section-#{@section}" : nil
|
anchor = @section ? "section-#{@section}" : nil
|
||||||
redirect_to project_wiki_page_path(@project, @page.title, :anchor => anchor)
|
redirect_to project_wiki_page_path(@project, @page.title, :anchor => anchor)
|
||||||
}
|
end
|
||||||
format.api {
|
format.api do
|
||||||
if was_new_page
|
if was_new_page
|
||||||
render :action => 'show', :status => :created, :location => project_wiki_page_path(@project, @page.title)
|
render :action => 'show', :status => :created, :location => project_wiki_page_path(@project, @page.title)
|
||||||
else
|
else
|
||||||
render_api_ok
|
render_api_ok
|
||||||
end
|
end
|
||||||
}
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
@ -206,10 +206,10 @@ class WikiController < ApplicationController
|
|||||||
rescue ActiveRecord::StaleObjectError, Redmine::WikiFormatting::StaleSectionError
|
rescue ActiveRecord::StaleObjectError, Redmine::WikiFormatting::StaleSectionError
|
||||||
# Optimistic locking exception
|
# Optimistic locking exception
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html do
|
||||||
flash.now[:error] = l(:notice_locking_conflict)
|
flash.now[:error] = l(:notice_locking_conflict)
|
||||||
render :action => 'edit'
|
render :action => 'edit'
|
||||||
}
|
end
|
||||||
format.api { render_api_head :conflict }
|
format.api { render_api_head :conflict }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -287,10 +287,10 @@ class WikiController < ApplicationController
|
|||||||
end
|
end
|
||||||
@page.destroy
|
@page.destroy
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html do
|
||||||
flash[:notice] = l(:notice_successful_delete)
|
flash[:notice] = l(:notice_successful_delete)
|
||||||
redirect_to project_wiki_index_path(@project)
|
redirect_to project_wiki_index_path(@project)
|
||||||
}
|
end
|
||||||
format.api { render_api_ok }
|
format.api { render_api_ok }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -312,13 +312,13 @@ class WikiController < ApplicationController
|
|||||||
includes([:content, {:attachments => :author}]).
|
includes([:content, {:attachments => :author}]).
|
||||||
to_a
|
to_a
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html do
|
||||||
export = render_to_string :action => 'export_multiple', :layout => false
|
export = render_to_string :action => 'export_multiple', :layout => false
|
||||||
send_data(export, :type => 'text/html', :filename => "wiki.html")
|
send_data(export, :type => 'text/html', :filename => "wiki.html")
|
||||||
}
|
end
|
||||||
format.pdf {
|
format.pdf do
|
||||||
send_file_headers! :type => 'application/pdf', :filename => "#{@project.identifier}.pdf"
|
send_file_headers! :type => 'application/pdf', :filename => "#{@project.identifier}.pdf"
|
||||||
}
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user