Export Multiple Pages to TeX
Per a suggestion of Marco Gualtieri.
This commit is contained in:
parent
1c5df9e8b5
commit
aee4f8b3a9
9 changed files with 312 additions and 278 deletions
|
@ -190,7 +190,7 @@ class ApplicationController < ActionController::Base
|
|||
response.charset = 'utf-8'
|
||||
if %w(atom_with_content atom_with_headlines).include?(action_name)
|
||||
response.content_type = Mime::ATOM
|
||||
elsif %w(tex).include?(action_name)
|
||||
elsif %w(tex tex_list).include?(action_name)
|
||||
response.content_type = Mime::TEXT
|
||||
elsif xhtml_enabled?
|
||||
if request.user_agent =~ /Validator/ or request.env.include?('HTTP_ACCEPT') &&
|
||||
|
@ -246,6 +246,17 @@ class ApplicationController < ActionController::Base
|
|||
(@web.published? and action_name == 's5')
|
||||
end
|
||||
|
||||
def is_post
|
||||
unless (request.post? || Rails.env.test?)
|
||||
layout = 'error'
|
||||
layout = false if %w(tex tex_list).include?(action_name)
|
||||
headers['Allow'] = 'POST'
|
||||
render(:status => 405, :text => 'You must use an HTTP POST', :layout => layout)
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
module Mime
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue