|
|
@@ -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 |