2007-03-12 20:59:02 +03:00
|
|
|
<div class="contextual">
|
2010-10-22 18:45:02 +04:00
|
|
|
<%= link_to(l(:label_attachment_new), new_project_file_path(@project), :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %>
|
2007-03-12 20:59:02 +03:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<h2><%=l(:label_attachment_plural)%></h2>
|
|
|
|
|
2008-12-09 19:54:46 +03:00
|
|
|
<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
|
2007-03-12 20:59:02 +03:00
|
|
|
|
2009-02-22 14:04:17 +03:00
|
|
|
<table class="list files">
|
2007-03-12 20:59:02 +03:00
|
|
|
<thead><tr>
|
2008-12-24 13:03:13 +03:00
|
|
|
<%= sort_header_tag('filename', :caption => l(:field_filename)) %>
|
|
|
|
<%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc') %>
|
|
|
|
<%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc') %>
|
|
|
|
<%= sort_header_tag('downloads', :caption => l(:label_downloads_abbr), :default_order => 'desc') %>
|
2007-03-12 20:59:02 +03:00
|
|
|
<th>MD5</th>
|
2008-12-09 21:00:27 +03:00
|
|
|
<th></th>
|
2007-03-12 20:59:02 +03:00
|
|
|
</tr></thead>
|
|
|
|
<tbody>
|
2011-09-17 16:07:37 +04:00
|
|
|
<% @containers.each do |container| %>
|
2008-12-09 21:00:27 +03:00
|
|
|
<% next if container.attachments.empty? -%>
|
2011-09-17 14:17:53 +04:00
|
|
|
<% if container.is_a?(Version) -%>
|
2009-02-22 14:04:17 +03:00
|
|
|
<tr>
|
2013-11-12 01:01:21 +04:00
|
|
|
<th colspan="6">
|
2011-09-17 14:17:53 +04:00
|
|
|
<%= link_to(h(container), {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package") %>
|
|
|
|
</th>
|
|
|
|
</tr>
|
|
|
|
<% end -%>
|
2011-09-17 16:07:37 +04:00
|
|
|
<% container.attachments.each do |file| %>
|
2009-02-22 14:04:17 +03:00
|
|
|
<tr class="file <%= cycle("odd", "even") %>">
|
|
|
|
<td class="filename"><%= link_to_attachment file, :download => true, :title => file.description %></td>
|
|
|
|
<td class="created_on"><%= format_time(file.created_on) %></td>
|
|
|
|
<td class="filesize"><%= number_to_human_size(file.filesize) %></td>
|
|
|
|
<td class="downloads"><%= file.downloads %></td>
|
|
|
|
<td class="digest"><%= file.digest %></td>
|
2013-11-12 01:01:21 +04:00
|
|
|
<td class="buttons">
|
2011-11-27 15:16:47 +04:00
|
|
|
<%= link_to(image_tag('delete.png'), attachment_path(file),
|
2012-07-07 18:36:49 +04:00
|
|
|
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
|
2007-03-12 20:59:02 +03:00
|
|
|
</td>
|
2011-09-17 16:07:37 +04:00
|
|
|
</tr>
|
2007-03-12 20:59:02 +03:00
|
|
|
<% end
|
|
|
|
reset_cycle %>
|
|
|
|
<% end %>
|
|
|
|
</tbody>
|
2007-12-07 21:42:40 +03:00
|
|
|
</table>
|
|
|
|
|
2008-01-03 01:41:53 +03:00
|
|
|
<% html_title(l(:label_attachment_plural)) -%>
|