aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/models/incoming_message.rb5
-rw-r--r--app/views/request/_bubble.rhtml38
2 files changed, 26 insertions, 17 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index a2a23b094..0d4a07d00 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -19,7 +19,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: incoming_message.rb,v 1.136 2008-08-29 19:59:13 francis Exp $
+# $Id: incoming_message.rb,v 1.137 2008-08-29 21:40:55 francis Exp $
# TODO
# Move some of the (e.g. quoting) functions here into rblib, as they feel
@@ -76,7 +76,8 @@ $file_extension_to_mime_type = {
"bmp" => 'image/bmp',
"html" => 'text/html', # XXX add htm
"vcf" => 'text/x-vcard',
- "zip" => 'application/zip'
+ "zip" => 'application/zip',
+ "delivery-status" => 'message/delivery-status'
}
# XXX doesn't have way of choosing default for inverse map - might want to add
# one when you need it
diff --git a/app/views/request/_bubble.rhtml b/app/views/request/_bubble.rhtml
index f3f053522..b44ea692e 100644
--- a/app/views/request/_bubble.rhtml
+++ b/app/views/request/_bubble.rhtml
@@ -1,20 +1,28 @@
<div class="correspondence_text">
<% if not attachments.nil? and attachments.size > 0 %>
- <p> <% attachments.each do |a| %>
- <% attachment_url = get_attachment_url(:id => incoming_message.info_request_id,
- :incoming_message_id => incoming_message.id, :part => a.url_part_number, :file_name => a.display_filename) %>
- <% img_filename = "icon_" + a.content_type.sub('/', '_') + "_large.png"
- full_filename = File.join(File.dirname(__FILE__), "../../../public/images", img_filename)
- if File.exist?(full_filename) %>
- <a href="<%=attachment_url%>"><img class="attachment_image" alt="Attachment" src="/images/<%=img_filename%>"></a>
- <% else %>
- Attachment:
- <% end %>
- <%= link_to a.display_filename, attachment_url %>
- <!-- (<%= a.content_type %>) -->
- <br>
+ <div class="attachments">
+ <hr class="top">
+ <% attachments.each do |a| %>
+ <p class="attachment">
+ <% attachment_url = get_attachment_url(:id => incoming_message.info_request_id,
+ :incoming_message_id => incoming_message.id, :part => a.url_part_number, :file_name => a.display_filename) %>
+ <% img_filename = "icon_" + a.content_type.sub('/', '_') + "_large.png"
+ full_filename = File.join(File.dirname(__FILE__), "../../../public/images", img_filename)
+ if File.exist?(full_filename) %>
+ <a href="<%=attachment_url%>"><img class="attachment_image" alt="Attachment" src="/images/<%=img_filename%>"></a>
+ <% else %>
+ <a href="<%=attachment_url%>"><img class="attachment_image" alt="Attachment" src="/images/icon_unknown.png"></a>
+ <% end %>
+ <strong><%= h a.display_filename %></strong>
+ <!-- <%= link_to h(a.display_filename), attachment_url %> -->
+ <br>
+ <%= a.body.size / 1024 %>K
+ <%= link_to "Download", attachment_url %>
+ <!-- (<%= a.content_type %>) -->
+ </p>
<% end %>
- </p>
+ <hr class="bottom">
+ </div>
<% end %>
<p><%= body %></p>
- </div> \ No newline at end of file
+ </div>