Export Multiple Pages to TeX

Per a suggestion of Marco Gualtieri.
This commit is contained in:
Jacques Distler 2010-10-09 02:57:37 -05:00
parent 1c5df9e8b5
commit aee4f8b3a9
9 changed files with 312 additions and 278 deletions

View file

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