list_files.rhtml
43 lines
| 1.7 KiB
| text/html+ruby
|
RhtmlLexer
|
r90 | <div class="contextual"> | |
|
r154 | <%= link_to_if_authorized l(:label_attachment_new), {:controller => 'projects', :action => 'add_file', :id => @project}, :class => 'icon icon-add' %> | |
|
r90 | </div> | |
|
r12 | <h2><%=l(:label_attachment_plural)%></h2> | |
|
r2 | ||
<% delete_allowed = authorize_for('versions', 'destroy_file') %> | |||
|
r105 | <table class="list"> | |
<thead><tr> | |||
|
r12 | <th><%=l(:field_version)%></th> | |
<th><%=l(:field_filename)%></th> | |||
<th><%=l(:label_date)%></th> | |||
<th><%=l(:field_filesize)%></th> | |||
|
r2 | <th>D/L</th> | |
<th>MD5</th> | |||
<% if delete_allowed %><th></th><% end %> | |||
|
r105 | </tr></thead> | |
<tbody> | |||
|
r2 | <% for version in @versions %> | |
|
r17 | <% unless version.attachments.empty? %> | |
|
r154 | <tr><th colspan="7" align="left"><span class="icon icon-package"><b><%= version.name %></b></span></th></tr> | |
|
r5 | <% for file in version.attachments %> | |
<tr class="<%= cycle("odd", "even") %>"> | |||
|
r2 | <td></td> | |
<td><%= link_to file.filename, :controller => 'versions', :action => 'download', :id => version, :attachment_id => file %></td> | |||
<td align="center"><%= format_date(file.created_on) %></td> | |||
|
r182 | <td align="center"><%= number_to_human_size(file.filesize) %></td> | |
|
r2 | <td align="center"><%= file.downloads %></td> | |
<td align="center"><small><%= file.digest %></small></td> | |||
<% if delete_allowed %> | |||
<td align="center"> | |||
|
r90 | <div class="contextual"> | |
|
r188 | <%= link_to_if_authorized '', {:controller => 'versions', :action => 'destroy_file', :id => version, :attachment_id => file}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %> | |
|
r90 | </div> | |
|
r2 | </td> | |
<% end %> | |||
</tr> | |||
|
r5 | <% end | |
reset_cycle %> | |||
|
r17 | <% end %> | |
|
r2 | <% end %> | |
|
r105 | </tbody> | |
|
r90 | </table> |