annotate app/views/projects/list_files.rhtml @ 0:513646585e45

* Import Redmine trunk SVN rev 3859
author Chris Cannam
date Fri, 23 Jul 2010 15:52:44 +0100
parents
children
rev   line source
Chris@0 1 <div class="contextual">
Chris@0 2 <%= link_to_if_authorized l(:label_attachment_new), {:controller => 'projects', :action => 'add_file', :id => @project}, :class => 'icon icon-add' %>
Chris@0 3 </div>
Chris@0 4
Chris@0 5 <h2><%=l(:label_attachment_plural)%></h2>
Chris@0 6
Chris@0 7 <% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
Chris@0 8
Chris@0 9 <table class="list files">
Chris@0 10 <thead><tr>
Chris@0 11 <%= sort_header_tag('filename', :caption => l(:field_filename)) %>
Chris@0 12 <%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc') %>
Chris@0 13 <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc') %>
Chris@0 14 <%= sort_header_tag('downloads', :caption => l(:label_downloads_abbr), :default_order => 'desc') %>
Chris@0 15 <th>MD5</th>
Chris@0 16 <th></th>
Chris@0 17 </tr></thead>
Chris@0 18 <tbody>
Chris@0 19 <% @containers.each do |container| %>
Chris@0 20 <% next if container.attachments.empty? -%>
Chris@0 21 <% if container.is_a?(Version) -%>
Chris@0 22 <tr>
Chris@0 23 <th colspan="6" align="left">
Chris@0 24 <%= link_to(h(container), {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package") %>
Chris@0 25 </th>
Chris@0 26 </tr>
Chris@0 27 <% end -%>
Chris@0 28 <% container.attachments.each do |file| %>
Chris@0 29 <tr class="file <%= cycle("odd", "even") %>">
Chris@0 30 <td class="filename"><%= link_to_attachment file, :download => true, :title => file.description %></td>
Chris@0 31 <td class="created_on"><%= format_time(file.created_on) %></td>
Chris@0 32 <td class="filesize"><%= number_to_human_size(file.filesize) %></td>
Chris@0 33 <td class="downloads"><%= file.downloads %></td>
Chris@0 34 <td class="digest"><%= file.digest %></td>
Chris@0 35 <td align="center">
Chris@0 36 <%= link_to(image_tag('delete.png'), {:controller => 'attachments', :action => 'destroy', :id => file},
Chris@0 37 :confirm => l(:text_are_you_sure), :method => :post) if delete_allowed %>
Chris@0 38 </td>
Chris@0 39 </tr>
Chris@0 40 <% end
Chris@0 41 reset_cycle %>
Chris@0 42 <% end %>
Chris@0 43 </tbody>
Chris@0 44 </table>
Chris@0 45
Chris@0 46 <% html_title(l(:label_attachment_plural)) -%>