list_files.rhtml
46 lines
| 1.8 KiB
| text/html+ruby
|
RhtmlLexer
|
r330 | <div class="contextual"> | ||
<%= link_to_if_authorized l(:label_attachment_new), {:controller => 'projects', :action => 'add_file', :id => @project}, :class => 'icon icon-add' %> | ||||
</div> | ||||
<h2><%=l(:label_attachment_plural)%></h2> | ||||
|
r2114 | <% delete_allowed = User.current.allowed_to?(:manage_files, @project) %> | ||
|
r330 | |||
|
r2452 | <table class="list files"> | ||
|
r330 | <thead><tr> | ||
|
r2169 | <%= 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') %> | ||||
|
r330 | <th>MD5</th> | ||
|
r2115 | <th></th> | ||
|
r330 | </tr></thead> | ||
<tbody> | ||||
|
r2115 | <% @containers.each do |container| %> | ||
<% next if container.attachments.empty? -%> | ||||
<% if container.is_a?(Version) -%> | ||||
|
r2452 | <tr> | ||
<th colspan="6" align="left"> | ||||
<%= link_to(h(container), {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package") %> | ||||
</th> | ||||
</tr> | ||||
|
r2115 | <% end -%> | ||
<% container.attachments.each do |file| %> | ||||
|
r2452 | <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> | ||||
|
r330 | <td align="center"> | ||
|
r2115 | <%= link_to(image_tag('delete.png'), {:controller => 'attachments', :action => 'destroy', :id => file}, | ||
:confirm => l(:text_are_you_sure), :method => :post) if delete_allowed %> | ||||
|
r330 | </td> | ||
|
r2 | </tr> | ||
|
r330 | <% end | ||
reset_cycle %> | ||||
<% end %> | ||||
</tbody> | ||||
|
r951 | </table> | ||
|
r1019 | <% html_title(l(:label_attachment_plural)) -%> | ||