2006-12-16 15:15:31 +03:00
|
|
|
<div class="contextual">
|
|
|
|
<%= link_to_if_authorized l(:label_attachment_new), {:controller => 'projects', :action => 'add_file', :id => @project}, :class => 'pic picAdd' %>
|
|
|
|
</div>
|
|
|
|
|
2006-07-29 23:54:22 +04:00
|
|
|
<h2><%=l(:label_attachment_plural)%></h2>
|
2006-06-28 22:11:03 +04:00
|
|
|
|
|
|
|
<% delete_allowed = authorize_for('versions', 'destroy_file') %>
|
|
|
|
|
2006-12-24 19:35:25 +03:00
|
|
|
<table class="list">
|
|
|
|
<thead><tr>
|
2006-07-29 23:54:22 +04:00
|
|
|
<th><%=l(:field_version)%></th>
|
|
|
|
<th><%=l(:field_filename)%></th>
|
|
|
|
<th><%=l(:label_date)%></th>
|
|
|
|
<th><%=l(:field_filesize)%></th>
|
2006-06-28 22:11:03 +04:00
|
|
|
<th>D/L</th>
|
|
|
|
<th>MD5</th>
|
|
|
|
<% if delete_allowed %><th></th><% end %>
|
2006-12-24 19:35:25 +03:00
|
|
|
</tr></thead>
|
|
|
|
<tbody>
|
2006-06-28 22:11:03 +04:00
|
|
|
<% for version in @versions %>
|
2006-07-30 20:19:35 +04:00
|
|
|
<% unless version.attachments.empty? %>
|
2006-12-24 19:35:25 +03:00
|
|
|
<tr><th colspan="7" align="left"><%= image_tag 'package' %> <b><%= version.name %></b></th></tr>
|
2006-07-09 20:30:01 +04:00
|
|
|
<% for file in version.attachments %>
|
|
|
|
<tr class="<%= cycle("odd", "even") %>">
|
2006-06-28 22:11:03 +04:00
|
|
|
<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>
|
2006-07-09 20:30:01 +04:00
|
|
|
<td align="center"><%= human_size(file.filesize) %></td>
|
2006-06-28 22:11:03 +04:00
|
|
|
<td align="center"><%= file.downloads %></td>
|
|
|
|
<td align="center"><small><%= file.digest %></small></td>
|
|
|
|
<% if delete_allowed %>
|
|
|
|
<td align="center">
|
2006-12-16 15:15:31 +03:00
|
|
|
<div class="contextual">
|
2006-12-17 17:22:09 +03:00
|
|
|
<%= link_to_if_authorized '', {:controller => 'versions', :action => 'destroy_file', :id => version, :attachment_id => file}, :confirm => l(:text_are_you_sure), :post => true, :class => 'pic picDelete' %>
|
2006-12-16 15:15:31 +03:00
|
|
|
</div>
|
2006-06-28 22:11:03 +04:00
|
|
|
</td>
|
|
|
|
<% end %>
|
|
|
|
</tr>
|
2006-07-09 20:30:01 +04:00
|
|
|
<% end
|
|
|
|
reset_cycle %>
|
2006-07-30 20:19:35 +04:00
|
|
|
<% end %>
|
2006-06-28 22:11:03 +04:00
|
|
|
<% end %>
|
2006-12-24 19:35:25 +03:00
|
|
|
</tbody>
|
2006-12-16 15:15:31 +03:00
|
|
|
</table>
|