_links.html.erb
42 lines
| 1.6 KiB
| text/plain
|
TextLexer
|
r538 | <div class="attachments"> | ||
|
r13283 | <div class="contextual"> | ||
|
r14889 | <%= link_to(l(:label_edit_attachments), | ||
|
r14686 | container_attachments_edit_path(container), | ||
:title => l(:label_edit_attachments), | ||||
:class => 'icon-only icon-edit' | ||||
) if options[:editable] %> | ||||
|
r13283 | </div> | ||
|
r538 | <% for attachment in attachments %> | ||
|
r8525 | <p><%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => true -%> | ||
|
r14942 | <% if attachment.is_text? || attachment.is_image? %> | ||
|
r14889 | <%= link_to l(:button_view), | ||
|
r14686 | { :controller => 'attachments', :action => 'show', | ||
:id => attachment, :filename => attachment.filename }, | ||||
|
r14889 | :class => 'icon-only icon-magnifier', | ||
|
r14686 | :title => l(:button_view) %> | ||
|
r8525 | <% end %> | ||
|
r13661 | <%= " - #{attachment.description}" unless attachment.description.blank? %> | ||
|
r9198 | <span class="size">(<%= number_to_human_size attachment.filesize %>)</span> | ||
|
r9190 | <% if options[:deletable] %> | ||
|
r14889 | <%= link_to l(:button_delete), attachment_path(attachment), | ||
|
r14686 | :data => {:confirm => l(:text_are_you_sure)}, | ||
:method => :delete, | ||||
:class => 'delete icon-only icon-del', | ||||
:title => l(:button_delete) %> | ||||
|
r1166 | <% 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> | ||