To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / app / views / attachments / _links.html.erb @ 1531:ae8145b28b2b

History | View | Annotate | Download (1.45 KB)

1
<div class="attachments">
2
<% for attachment in attachments %>
3
<p><%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
4
  <% if attachment.is_text? %>
5
    <%= link_to image_tag('magnifier.png'),
6
                :controller => 'attachments', :action => 'show',
7
                :id => attachment, :filename => attachment.filename %>
8
  <% end %>
9
  <%= h(" - #{attachment.description}") unless attachment.description.blank? %>
10
  <span class="size_and_count"><%= number_to_human_size attachment.filesize %><%= ", " + l(:label_x_downloads, :count => attachment.downloads) unless attachment.downloads == 0 %></span>
11
  <% if options[:deletable] %>
12
    <%= link_to image_tag('delete.png'), attachment_path(attachment),
13
                                         :data => {:confirm => l(:text_are_you_sure)},
14
                                         :method => :delete,
15
                                         :class => 'delete',
16
                                         :title => l(:button_delete) %>
17
  <% end %>
18
  <% if options[:author] %>
19
    <span class="author"><%= h(attachment.author) %>, <%= format_time(attachment.created_on) %></span>
20
  <% end %>
21
  </p>
22
<% end %>
23
<% if defined?(thumbnails) && thumbnails %>
24
  <% images = attachments.select(&:thumbnailable?) %>
25
  <% if images.any? %>
26
  <div class="thumbnails">
27
    <% images.each do |attachment| %>
28
      <div><%= thumbnail_tag(attachment) %></div>
29
    <% end %>
30
  </div>
31
  <% end %>
32
<% end %>
33
</div>