aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/request/_bubble.html.erb
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/request/_bubble.html.erb')
-rw-r--r--app/views/request/_bubble.html.erb37
1 files changed, 37 insertions, 0 deletions
diff --git a/app/views/request/_bubble.html.erb b/app/views/request/_bubble.html.erb
new file mode 100644
index 000000000..747e2aa1f
--- /dev/null
+++ b/app/views/request/_bubble.html.erb
@@ -0,0 +1,37 @@
+ <div class="correspondence_text">
+ <% if not attachments.nil? and attachments.size > 0 %>
+ <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)
+ attachment_as_html_url = get_attachment_as_html_url(:id => incoming_message.info_request_id,
+ :incoming_message_id => incoming_message.id, :part => a.url_part_number,
+ :file_name => a.display_filename + '.html')
+ %>
+ <% img_filename = "icon_" + a.content_type.sub('/', '_') + "_large.png"
+ full_filename = File.expand_path(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>
+ <br>
+ <%= a.display_size %>
+ <%= link_to "Download", attachment_url %>
+ <% if a.has_body_as_html? && incoming_message.info_request.all_can_view? %>
+ <%= link_to "View as HTML", attachment_as_html_url %>
+ <% end %>
+ <!-- (<%= a.content_type %>) -->
+ <%= a.extra_note %>
+ </p>
+ <% end %>
+ <hr class="bottom">
+ </div>
+ <% end %>
+ <p><%= body %></p>
+ </div>