aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/request/_bubble.rhtml
blob: f3f053522dd42b1c35f9ebd6a8342c0343f99b23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
    <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>
                <% end %>
            </p>
        <% end %>
        <p><%= body %></p>
    </div>