2007-05-26 15:42:37 +00:00
|
|
|
<div class="attachments">
|
2014-11-29 13:41:53 +00:00
|
|
|
<div class="contextual">
|
2024-10-19 10:06:26 +00:00
|
|
|
<%= link_to(sprite_icon('edit', l(:label_edit_attachments)),
|
2016-01-20 08:50:39 +00:00
|
|
|
container_attachments_edit_path(container),
|
|
|
|
|
:title => l(:label_edit_attachments),
|
2024-08-29 21:46:40 +00:00
|
|
|
:class => 'icon-only icon-edit '
|
2016-01-20 08:50:39 +00:00
|
|
|
) if options[:editable] %>
|
2024-10-19 10:06:26 +00:00
|
|
|
<%= link_to(sprite_icon('download', l(:label_download_all_attachments)),
|
2020-03-21 05:59:31 +00:00
|
|
|
container_attachments_download_path(container),
|
|
|
|
|
:title => l(:label_download_all_attachments),
|
2024-08-29 21:46:40 +00:00
|
|
|
:class => 'icon-only icon-download '
|
2020-03-21 05:59:31 +00:00
|
|
|
) if attachments.size > 1 %>
|
2014-11-29 13:41:53 +00:00
|
|
|
</div>
|
2017-06-10 10:30:59 +00:00
|
|
|
<table>
|
2007-05-26 15:42:37 +00:00
|
|
|
<% for attachment in attachments %>
|
2017-06-10 10:30:59 +00:00
|
|
|
<tr>
|
|
|
|
|
<td>
|
2026-02-09 02:46:13 +00:00
|
|
|
<%= link_to_attachment attachment, class: 'icon icon-attachment ', icon: icon_for_mime_type(attachment.content_type) -%>
|
2017-06-10 10:30:59 +00:00
|
|
|
<span class="size">(<%= number_to_human_size attachment.filesize %>)</span>
|
2024-11-05 22:01:19 +00:00
|
|
|
<%= link_to_attachment attachment, class: 'icon-only icon-download ', title: l(:button_download), download: true, icon: 'download' -%>
|
2017-06-10 10:30:59 +00:00
|
|
|
</td>
|
|
|
|
|
<td><%= attachment.description unless attachment.description.blank? %></td>
|
|
|
|
|
<td>
|
|
|
|
|
<% if options[:author] %>
|
|
|
|
|
<span class="author"><%= attachment.author %>, <%= format_time(attachment.created_on) %></span>
|
|
|
|
|
<% end %>
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
<% if options[:deletable] %>
|
2024-10-19 10:06:26 +00:00
|
|
|
<%= link_to sprite_icon('del', l(:button_delete)), attachment_path(attachment),
|
2017-06-10 10:30:59 +00:00
|
|
|
:data => {:confirm => l(:text_are_you_sure)},
|
|
|
|
|
:method => :delete,
|
2024-08-29 21:46:40 +00:00
|
|
|
:class => 'delete icon-only icon-del ',
|
2017-06-10 10:30:59 +00:00
|
|
|
:title => l(:button_delete) %>
|
|
|
|
|
<% end %>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
2007-05-26 15:42:37 +00:00
|
|
|
<% end %>
|
2017-06-10 10:30:59 +00:00
|
|
|
</table>
|
2012-07-07 13:48:07 +00:00
|
|
|
<% if defined?(thumbnails) && thumbnails %>
|
|
|
|
|
<% images = attachments.select(&:thumbnailable?) %>
|
|
|
|
|
<% if images.any? %>
|
|
|
|
|
<div class="thumbnails">
|
|
|
|
|
<% images.each do |attachment| %>
|
2025-01-23 01:41:22 +00:00
|
|
|
<%= thumbnail_tag(attachment) %>
|
2012-07-07 13:48:07 +00:00
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% end %>
|
2007-05-26 15:42:37 +00:00
|
|
|
</div>
|