6 |
6 |
|
7 |
7 |
<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
|
8 |
8 |
|
9 |
|
<table class="list files">
|
10 |
|
<thead><tr>
|
11 |
|
<%= sort_header_tag('filename', :caption => l(:field_filename)) %>
|
12 |
|
<%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc') %>
|
13 |
|
<%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc') %>
|
14 |
|
<%= sort_header_tag('downloads', :caption => l(:label_downloads_abbr), :default_order => 'desc') %>
|
15 |
|
<th><%= l(:field_digest) %></th>
|
16 |
|
<th></th>
|
17 |
|
</tr></thead>
|
18 |
|
<tbody>
|
19 |
|
<% @containers.each do |container| %>
|
20 |
|
<% next if container.attachments.empty? -%>
|
21 |
|
<% if container.is_a?(Version) -%>
|
22 |
|
<tr>
|
23 |
|
<th colspan="6">
|
24 |
|
<%= link_to(container, {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package") %>
|
25 |
|
</th>
|
26 |
|
</tr>
|
27 |
|
<% end -%>
|
28 |
|
<% container.attachments.each do |file| %>
|
29 |
|
<tr class="file">
|
30 |
|
<td class="filename"><%= link_to_attachment file, :title => file.description -%></td>
|
31 |
|
<td class="created_on"><%= format_time(file.created_on) %></td>
|
32 |
|
<td class="filesize"><%= number_to_human_size(file.filesize) %></td>
|
33 |
|
<td class="downloads"><%= file.downloads %></td>
|
34 |
|
<td class="digest"><%= file.digest_type %>: <%= file.digest %></td>
|
35 |
|
<td class="buttons">
|
36 |
|
<%= link_to_attachment file, class: 'icon-only icon-download', title: l(:button_download), download: true %>
|
37 |
|
<%= link_to(l(:button_delete), attachment_path(file), :class => 'icon-only icon-del',
|
38 |
|
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
|
39 |
|
</td>
|
40 |
|
</tr>
|
|
9 |
<div class="autoscroll">
|
|
10 |
<table class="list files">
|
|
11 |
<thead><tr>
|
|
12 |
<%= sort_header_tag('filename', :caption => l(:field_filename)) %>
|
|
13 |
<%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc') %>
|
|
14 |
<%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc') %>
|
|
15 |
<%= sort_header_tag('downloads', :caption => l(:label_downloads_abbr), :default_order => 'desc') %>
|
|
16 |
<th><%= l(:field_digest) %></th>
|
|
17 |
<th></th>
|
|
18 |
</tr></thead>
|
|
19 |
<tbody>
|
|
20 |
<% @containers.each do |container| %>
|
|
21 |
<% next if container.attachments.empty? -%>
|
|
22 |
<% if container.is_a?(Version) -%>
|
|
23 |
<tr>
|
|
24 |
<th colspan="6">
|
|
25 |
<%= link_to(container, {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package") %>
|
|
26 |
</th>
|
|
27 |
</tr>
|
|
28 |
<% end -%>
|
|
29 |
<% container.attachments.each do |file| %>
|
|
30 |
<tr class="file">
|
|
31 |
<td class="filename"><%= link_to_attachment file, :title => file.description -%></td>
|
|
32 |
<td class="created_on"><%= format_time(file.created_on) %></td>
|
|
33 |
<td class="filesize"><%= number_to_human_size(file.filesize) %></td>
|
|
34 |
<td class="downloads"><%= file.downloads %></td>
|
|
35 |
<td class="digest"><%= file.digest_type %>: <%= file.digest %></td>
|
|
36 |
<td class="buttons">
|
|
37 |
<%= link_to_attachment file, class: 'icon-only icon-download', title: l(:button_download), download: true %>
|
|
38 |
<%= link_to(l(:button_delete), attachment_path(file), :class => 'icon-only icon-del',
|
|
39 |
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
|
|
40 |
</td>
|
|
41 |
</tr>
|
|
42 |
<% end %>
|
41 |
43 |
<% end %>
|
42 |
|
<% end %>
|
43 |
|
</tbody>
|
44 |
|
</table>
|
|
44 |
</tbody>
|
|
45 |
</table>
|
|
46 |
</div>
|
45 |
47 |
|
46 |
48 |
<% html_title(l(:label_attachment_plural)) -%>
|