mirror of
https://github.com/redmine/redmine.git
synced 2025-12-16 05:20:28 +01: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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user