To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / app / views / files / index.html.erb @ 442:753f1380d6bc

History | View | Annotate | Download (1.83 KB)

1
<div class="contextual">
2
<%= link_to(l(:label_attachment_new), new_project_file_path(@project), :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %>
3
</div>
4

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

    
7
<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
8

    
9
<table class="list files">
10
  <thead><tr>
11
    <%= sort_header_tag('filename', :caption => l(:field_filename)) %>
12
    <%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc') %>
13
    <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc') %>
14
    <%= sort_header_tag('downloads', :caption => l(:label_downloads_abbr), :default_order => 'desc') %>
15
    <th>MD5</th>
16
    <th></th>
17
  </tr></thead>
18
  <tbody>
19
<% @containers.each do |container| %>        
20
  <% next if container.attachments.empty? -%>
21
        <% if container.is_a?(Version) -%>
22
  <tr>
23
          <th colspan="6" align="left">
24
                  <%= link_to(h(container), {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package") %>
25
                </th>
26
        </tr>
27
        <% end -%>
28
  <% container.attachments.each do |file| %>                
29
  <tr class="file <%= cycle("odd", "even") %>">
30
    <td class="filename"><%= link_to_attachment file, :download => true, :title => file.description %></td>
31
    <td class="created_on"><%= format_time(file.created_on) %></td>
32
    <td class="filesize"><%= number_to_human_size(file.filesize) %></td>
33
    <td class="downloads"><%= file.downloads %></td>
34
    <td class="digest"><%= file.digest %></td>
35
    <td align="center">
36
    <%= link_to(image_tag('delete.png'), {:controller => 'attachments', :action => 'destroy', :id => file},
37
                                                                                                                                                                 :confirm => l(:text_are_you_sure), :method => :post) if delete_allowed %>
38
    </td>
39
  </tr>                
40
  <% end
41
  reset_cycle %>
42
<% end %>
43
  </tbody>
44
</table>
45

    
46
<% html_title(l(:label_attachment_plural)) -%>