2007-03-12 20:59:02 +03:00
|
|
|
<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>
|
|
|
|
|
|
|
|
<% delete_allowed = authorize_for('versions', 'destroy_file') %>
|
|
|
|
|
|
|
|
<table class="list">
|
|
|
|
<thead><tr>
|
|
|
|
<th><%=l(:field_version)%></th>
|
|
|
|
<th><%=l(:field_filename)%></th>
|
|
|
|
<th><%=l(:label_date)%></th>
|
|
|
|
<th><%=l(:field_filesize)%></th>
|
|
|
|
<th>D/L</th>
|
|
|
|
<th>MD5</th>
|
|
|
|
<% if delete_allowed %><th></th><% end %>
|
|
|
|
</tr></thead>
|
|
|
|
<tbody>
|
|
|
|
<% for version in @versions %>
|
|
|
|
<% unless version.attachments.empty? %>
|
|
|
|
<tr><th colspan="7" align="left"><span class="icon icon-package"><b><%= version.name %></b></span></th></tr>
|
2006-07-09 20:30:01 +04:00
|
|
|
<% for file in version.attachments %>
|
2007-03-12 20:59:02 +03:00
|
|
|
<tr class="<%= cycle("odd", "even") %>">
|
|
|
|
<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>
|
|
|
|
<td align="center"><%= number_to_human_size(file.filesize) %></td>
|
2006-06-28 22:11:03 +04:00
|
|
|
<td align="center"><%= file.downloads %></td>
|
2007-03-12 20:59:02 +03:00
|
|
|
<td align="center"><small><%= file.digest %></small></td>
|
|
|
|
<% if delete_allowed %>
|
|
|
|
<td align="center">
|
|
|
|
<div class="contextual">
|
2007-07-02 19:32:42 +04:00
|
|
|
<%= link_to_if_authorized image_tag('delete.png'), {:controller => 'versions', :action => 'destroy_file', :id => version, :attachment_id => file}, :confirm => l(:text_are_you_sure), :method => :post %>
|
2007-03-12 20:59:02 +03:00
|
|
|
</div>
|
|
|
|
</td>
|
2006-06-28 22:11:03 +04:00
|
|
|
<% end %>
|
|
|
|
</tr>
|
2007-03-12 20:59:02 +03:00
|
|
|
<% end
|
|
|
|
reset_cycle %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</tbody>
|
2007-12-07 21:42:40 +03:00
|
|
|
</table>
|
|
|
|
|
|
|
|
<% set_html_title l(:label_attachment_plural) -%>
|