GitLab steht Mittwoch, den 08. Juli, zwischen 09:00 und 13:00 Uhr aufgrund von Wartungsarbeiten nicht zur Verfügung.

Commit cd6c10e8 authored by tmaruyama's avatar tmaruyama

pdf: add a new feature to export wiki pdf (#401)

Contributed by Jun NAITOH.

git-svn-id: https://svn.redmine.org/redmine/trunk@7741 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 08330574
......@@ -40,6 +40,7 @@ class WikiController < ApplicationController
helper :attachments
include AttachmentsHelper
helper :watchers
include Redmine::Export::PDF
# List of pages, sorted alphabetically and by parent (hierarchy)
def index
......@@ -71,7 +72,10 @@ class WikiController < ApplicationController
end
@content = @page.content_for_version(params[:version])
if User.current.allowed_to?(:export_wiki_pages, @project)
if params[:format] == 'html'
if params[:format] == 'pdf'
send_data(wiki_to_pdf(@page, @project), :type => 'application/pdf', :filename => "#{@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")
return
......
......@@ -53,6 +53,7 @@
<% end %>
<% other_formats_links do |f| %>
<%= f.link_to 'PDF', :url => {:id => @page.title, :version => @content.version} %>
<%= f.link_to 'HTML', :url => {:id => @page.title, :version => @content.version} %>
<%= f.link_to 'TXT', :url => {:id => @page.title, :version => @content.version} %>
<% end if User.current.allowed_to?(:export_wiki_pages, @project) %>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment