blob: 94498612a5373ca0fe469ec2ae2421f1340fdce2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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_path = get_attachment_path(: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_path = get_attachment_as_html_path(: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_path%>"><img class="attachment_image" alt="Attachment" src="/images/<%=img_filename%>"></a>
<% else %>
<a href="<%=attachment_path%>"><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_path %>
<% if a.has_body_as_html? && incoming_message.info_request.all_can_view? %>
<%= link_to "View as HTML", attachment_as_html_path %>
<% end %>
<!-- (<%= a.content_type %>) -->
<%= a.extra_note %>
</p>
<% end %>
<hr class="bottom">
</div>
<% end %>
<p><%= body %></p>
</div>
|