list_files.rhtml
42 lines
| 1.6 KiB
| text/html+ruby
|
RhtmlLexer
|
r90 | <div class="contextual"> | |
<%= link_to_if_authorized l(:label_attachment_new), {:controller => 'projects', :action => 'add_file', :id => @project}, :class => 'pic picAdd' %> | |||
</div> | |||
|
r12 | <h2><%=l(:label_attachment_plural)%></h2> | |
|
r2 | ||
<% delete_allowed = authorize_for('versions', 'destroy_file') %> | |||
|
r19 | <table class="listTableContent"> | |
|
r2 | <tr class="ListHead"> | |
|
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 %> | |||
</tr> | |||
<% for version in @versions %> | |||
|
r17 | <% unless version.attachments.empty? %> | |
<tr><td colspan="7"><%= image_tag 'package' %> <b><%= version.name %></b></td></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> | |||
|
r5 | <td align="center"><%= 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"> | |
<%= link_to_if_authorized l(:button_delete), {:controller => 'versions', :action => 'destroy_file', :id => version, :attachment_id => file}, :confirm => l(:text_are_you_sure), :post => true, :class => 'pic picDelete' %> | |||
</div> | |||
|
r2 | </td> | |
<% end %> | |||
</tr> | |||
|
r5 | <% end | |
reset_cycle %> | |||
|
r17 | <% end %> | |
|
r2 | <% end %> | |
|
r90 | </table> |