parent
463edeee71
commit
19530df395
@ -1,8 +1,24 @@
|
||||
<% for attachment in attachments %>
|
||||
<%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
|
||||
<% if attachment.is_text? %>
|
||||
<%= link_to image_tag('magnifier.png'),
|
||||
:controller => 'attachments', :action => 'show',
|
||||
:id => attachment, :filename => attachment.filename %>
|
||||
<table style="width: 200px;table-layout: fixed" >
|
||||
<tr>
|
||||
<% count = 0 %>
|
||||
<% for attachment in attachments %>
|
||||
<% if attachments.count == 1 %>
|
||||
<td title="<%= attachment.filename%>" style="width: 200px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
|
||||
<%= render :partial => 'attachment', :locals => {:attachment => attachment} %>
|
||||
</td>
|
||||
<% elsif attachments.count == 2 %>
|
||||
<td title="<%= attachment.filename%>" style="width: 100px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
|
||||
<%= render :partial => 'attachment', :locals => {:attachment => attachment} %>
|
||||
</td>
|
||||
<% else %>
|
||||
<td title="<%= attachment.filename%>" style="width: 66px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
|
||||
<% if count == 3 %>
|
||||
<% break %>
|
||||
<% end %>
|
||||
<% end -%>
|
||||
<%= render :partial => 'attachment', :locals => {:attachment => attachment} %>
|
||||
<% count = count +1 %>
|
||||
</td>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tr>
|
||||
</table>
|
@ -0,0 +1,6 @@
|
||||
<%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
|
||||
<% if attachment.is_text? %>
|
||||
<%= link_to image_tag('magnifier.png'),
|
||||
:controller => 'attachments', :action => 'show',
|
||||
:id => attachment, :filename => attachment.filename,:style => "width:50px"%>
|
||||
<% end %>
|
Loading…
Reference in new issue