list_files.rhtml
42 lines
| 1.7 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 | |||
<table class="list"> | ||||
<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) -%> | ||||
<tr><th colspan="6" align="left"><span class="icon icon-package"><b><%=h container %></b></span></th></tr> | ||||
<% end -%> | ||||
<% container.attachments.each do |file| %> | ||||
|
r330 | <tr class="<%= cycle("odd", "even") %>"> | ||
|
r1669 | <td><%= link_to_attachment file, :download => true, :title => file.description %></td> | ||
|
r1201 | <td align="center"><%= format_time(file.created_on) %></td> | ||
|
r330 | <td align="center"><%= number_to_human_size(file.filesize) %></td> | ||
|
r2 | <td align="center"><%= file.downloads %></td> | ||
|
r330 | <td align="center"><small><%= file.digest %></small></td> | ||
<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)) -%> | ||