_links.html.erb
38 lines
| 1.5 KiB
| text/plain
|
TextLexer
|
r538 | <div class="attachments"> | ||
|
r13283 | <div class="contextual"> | ||
|
r13285 | <%= link_to image_tag('edit.png'), | ||
container_attachments_edit_path(container), | ||||
|
r13553 | :title => l(:label_edit_attachments) if options[:editable] %> | ||
|
r13283 | </div> | ||
|
r538 | <% for attachment in attachments %> | ||
|
r8525 | <p><%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => true -%> | ||
|
r9190 | <% if attachment.is_text? %> | ||
<%= link_to image_tag('magnifier.png'), | ||||
|
r8525 | :controller => 'attachments', :action => 'show', | ||
:id => attachment, :filename => attachment.filename %> | ||||
<% end %> | ||||
|
r13661 | <%= " - #{attachment.description}" unless attachment.description.blank? %> | ||
|
r9198 | <span class="size">(<%= number_to_human_size attachment.filesize %>)</span> | ||
|
r9190 | <% if options[:deletable] %> | ||
|
r7828 | <%= link_to image_tag('delete.png'), attachment_path(attachment), | ||
|
r9754 | :data => {:confirm => l(:text_are_you_sure)}, | ||
|
r7828 | :method => :delete, | ||
|
r1166 | :class => 'delete', | ||
:title => l(:button_delete) %> | ||||
<% end %> | ||||
|
r2114 | <% if options[:author] %> | ||
|
r13661 | <span class="author"><%= attachment.author %>, <%= format_time(attachment.created_on) %></span> | ||
|
r538 | <% end %> | ||
</p> | ||||
<% end %> | ||||
|
r9750 | <% if defined?(thumbnails) && thumbnails %> | ||
<% images = attachments.select(&:thumbnailable?) %> | ||||
<% if images.any? %> | ||||
<div class="thumbnails"> | ||||
<% images.each do |attachment| %> | ||||
<div><%= thumbnail_tag(attachment) %></div> | ||||
<% end %> | ||||
</div> | ||||
<% end %> | ||||
<% end %> | ||||
|
r538 | </div> | ||