chris@22
|
1 <div class="contextual">
|
chris@37
|
2 <%= link_to(l(:label_attachment_new), new_project_file_path(@project), :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %>
|
chris@22
|
3 </div>
|
chris@22
|
4
|
chris@22
|
5 <h2><%=l(:label_attachment_plural)%></h2>
|
chris@22
|
6
|
chris@22
|
7 <% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
|
chris@22
|
8
|
chris@22
|
9 <table class="list files">
|
chris@22
|
10 <thead><tr>
|
chris@22
|
11 <%= sort_header_tag('filename', :caption => l(:field_filename)) %>
|
chris@22
|
12 <%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc') %>
|
chris@22
|
13 <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc') %>
|
chris@22
|
14 <%= sort_header_tag('downloads', :caption => l(:label_downloads_abbr), :default_order => 'desc') %>
|
chris@22
|
15 <th>MD5</th>
|
chris@22
|
16 <th></th>
|
chris@22
|
17 </tr></thead>
|
chris@22
|
18 <tbody>
|
chris@22
|
19 <% @containers.each do |container| %>
|
chris@22
|
20 <% next if container.attachments.empty? -%>
|
chris@22
|
21 <% if container.is_a?(Version) -%>
|
chris@22
|
22 <tr>
|
chris@22
|
23 <th colspan="6" align="left">
|
chris@22
|
24 <%= link_to(h(container), {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package") %>
|
chris@22
|
25 </th>
|
chris@22
|
26 </tr>
|
chris@22
|
27 <% end -%>
|
chris@22
|
28 <% container.attachments.each do |file| %>
|
chris@22
|
29 <tr class="file <%= cycle("odd", "even") %>">
|
chris@22
|
30 <td class="filename"><%= link_to_attachment file, :download => true, :title => file.description %></td>
|
chris@22
|
31 <td class="created_on"><%= format_time(file.created_on) %></td>
|
chris@22
|
32 <td class="filesize"><%= number_to_human_size(file.filesize) %></td>
|
chris@22
|
33 <td class="downloads"><%= file.downloads %></td>
|
chris@22
|
34 <td class="digest"><%= file.digest %></td>
|
chris@22
|
35 <td align="center">
|
chris@22
|
36 <%= link_to(image_tag('delete.png'), {:controller => 'attachments', :action => 'destroy', :id => file},
|
chris@22
|
37 :confirm => l(:text_are_you_sure), :method => :post) if delete_allowed %>
|
chris@22
|
38 </td>
|
chris@22
|
39 </tr>
|
chris@22
|
40 <% end
|
chris@22
|
41 reset_cycle %>
|
chris@22
|
42 <% end %>
|
chris@22
|
43 </tbody>
|
chris@22
|
44 </table>
|
chris@22
|
45
|
chris@22
|
46 <% html_title(l(:label_attachment_plural)) -%>
|