aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/incoming_message.rb
diff options
context:
space:
mode:
authorFrancis Irving <francis@mysociety.org>2010-03-10 15:25:01 +0000
committerFrancis Irving <francis@mysociety.org>2010-03-10 15:25:01 +0000
commit1dea40cd2d2ff1217f8e3145df9f3efc31226fe8 (patch)
tree4c15f61841ee4fbec2a3a0a787e36d9bc2b27bb4 /app/models/incoming_message.rb
parenta4a72595c99ff5f8555a94231a6f24a25a6819b2 (diff)
Fix up styling on view XLS as HTML
Diffstat (limited to 'app/models/incoming_message.rb')
-rw-r--r--app/models/incoming_message.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index 242fc3ebf..4bab7b6ec 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -341,7 +341,7 @@ class FOIAttachment
# For "View as HTML" of attachment
def body_as_html(dir)
html = nil
- wrapper_class = "default_output"
+ wrapper_id = "wrapper"
# simple cases, can never fail
if self.content_type == 'text/plain'
@@ -349,7 +349,7 @@ class FOIAttachment
text = CGI.escapeHTML(text)
text = MySociety::Format.make_clickable(text)
html = text.gsub(/\n/, '<br>')
- return "<html><head></head><body>" + html + "</body></html>", wrapper_class
+ return "<html><head></head><body>" + html + "</body></html>", wrapper_id
end
# the extractions will also produce image files, which go in the
@@ -368,7 +368,7 @@ class FOIAttachment
elsif self.content_type == 'application/vnd.ms-excel'
IO.popen("/usr/bin/xlhtml -a " + tempfile.path + "", "r") do |child|
html = child.read()
- wrapper_class = "xhtml_output"
+ wrapper_id = "wrapper_xlhtml"
end
elsif self.content_type == 'application/pdf'
IO.popen("/usr/bin/pdftohtml -nodrm -zoom 1.0 -stdout -enc UTF-8 -noframes " + tempfile.path + "", "r") do |child|
@@ -398,10 +398,10 @@ class FOIAttachment
body_without_tags = body.gsub(/\s+/,"").gsub(/\<[^\>]*\>/, "")
contains_images = html.match(/<img/mi) ? true : false
if !$?.success? || html.size == 0 || (body_without_tags.size == 0 && !contains_images)
- return "<html><head></head><body><p>Sorry, the conversion to HTML failed. Please use the download link at the top right.</p></body></html>"
+ return "<html><head></head><body><p>Sorry, the conversion to HTML failed. Please use the download link at the top right.</p></body></html>", wrapper_id
end
- return html, wrapper_class
+ return html, wrapper_id
end
end