mirror of
https://github.com/meineerde/redmine.git
synced 2026-01-10 17:41:31 +00:00
shorten long line of GanttsController
git-svn-id: http://svn.redmine.org/redmine/trunk@20180 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
8a7bfc57a4
commit
58a04e2aff
@ -40,9 +40,19 @@ class GanttsController < ApplicationController
|
||||
basename = (@project ? "#{@project.identifier}-" : '') + 'gantt'
|
||||
|
||||
respond_to do |format|
|
||||
format.html { render :action => "show", :layout => !request.xhr? }
|
||||
format.png { send_data(@gantt.to_image, :disposition => 'inline', :type => 'image/png', :filename => "#{basename}.png") } if @gantt.respond_to?('to_image')
|
||||
format.pdf { send_data(@gantt.to_pdf, :type => 'application/pdf', :filename => "#{basename}.pdf") }
|
||||
format.html {render :action => "show", :layout => !request.xhr?}
|
||||
if @gantt.respond_to?('to_image')
|
||||
format.png do
|
||||
send_data(@gantt.to_image,
|
||||
:disposition => 'inline', :type => 'image/png',
|
||||
:filename => "#{basename}.png")
|
||||
end
|
||||
end
|
||||
format.pdf do
|
||||
send_data(@gantt.to_pdf,
|
||||
:type => 'application/pdf',
|
||||
:filename => "#{basename}.pdf")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user