|
|
|
@ -82,14 +82,14 @@ class WikiController < ApplicationController
|
|
|
|
|
@content = @page.content_for_version(params[:version])
|
|
|
|
|
if User.current.allowed_to?(:export_wiki_pages, @project)
|
|
|
|
|
if params[:format] == 'pdf'
|
|
|
|
|
send_data(wiki_page_to_pdf(@page, @project), :type => 'application/pdf', :filename => "#{@page.title}.pdf")
|
|
|
|
|
send_data(wiki_page_to_pdf(@page, @project), :type => 'application/pdf', :filename => filename_for_content_disposition("#{@page.title}.pdf") )
|
|
|
|
|
return
|
|
|
|
|
elsif params[:format] == 'html'
|
|
|
|
|
export = render_to_string :action => 'export', :layout => false
|
|
|
|
|
send_data(export, :type => 'text/html', :filename => "#{@page.title}.html")
|
|
|
|
|
send_data(export, :type => 'text/html', :filename => filename_for_content_disposition("#{@page.title}.html"))
|
|
|
|
|
return
|
|
|
|
|
elsif params[:format] == 'txt'
|
|
|
|
|
send_data(@content.text, :type => 'text/plain', :filename => "#{@page.title}.txt")
|
|
|
|
|
send_data(@content.text, :type => 'text/plain', :filename => filename_for_content_disposition("#{@page.title}.txt") )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@ -286,7 +286,7 @@ class WikiController < ApplicationController
|
|
|
|
|
send_data(export, :type => 'text/html', :filename => "wiki.html")
|
|
|
|
|
}
|
|
|
|
|
format.pdf {
|
|
|
|
|
send_data(wiki_pages_to_pdf(@pages, @project), :type => 'application/pdf', :filename => "#{@project.identifier}.pdf")
|
|
|
|
|
send_data(wiki_pages_to_pdf(@pages, @project), :type => 'application/pdf', :filename => filename_for_content_disposition("#{@project.identifier}.pdf") )
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|