summaryrefslogtreecommitdiffstats
path: root/app/views/projects/list_files.rhtml
blob: 61c6d2c80a9cc8dd40faee5331e7cad9d46f67b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<div class="contextual">
<%= link_to_if_authorized l(:label_attachment_new), {:controller => 'projects', :action => 'add_file', :id => @project}, :class => 'pic picAdd' %>
</div>

<h2><%=l(:label_attachment_plural)%></h2>

<% delete_allowed = authorize_for('versions', 'destroy_file') %>

<table class="listTableContent">
  <tr class="ListHead">
    <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>
  
<% for version in @versions %>	
  <% unless version.attachments.empty? %>
  <tr><td colspan="7"><%= image_tag 'package' %> <b><%= version.name %></b></td></tr>
  <% for file in version.attachments %>		
  <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"><%= human_size(file.filesize) %></td>
    <td align="center"><%= file.downloads %></td>
    <td align="center"><small><%= file.digest %></small></td>
    <% if delete_allowed %>
    <td align="center">
        <div class="contextual">
        <%= 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' %>
        </div>
    </td>
    <% end %>
  </tr>		
  <% end
  reset_cycle %>
  <% end %>
<% end %>
</table>