You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.html.erb 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. <h2><%=l(:label_attachment_plural)%></h2>
  5. <% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
  6. <div class="autoscroll">
  7. <table class="list files">
  8. <thead><tr>
  9. <%= sort_header_tag('filename', :caption => l(:field_filename)) %>
  10. <%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc') %>
  11. <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc') %>
  12. <%= sort_header_tag('downloads', :caption => l(:label_downloads_abbr), :default_order => 'desc') %>
  13. <th><%= l(:field_digest) %></th>
  14. <th></th>
  15. </tr></thead>
  16. <tbody>
  17. <% @containers.each do |container| %>
  18. <% next if container.attachments.empty? -%>
  19. <% if container.is_a?(Version) -%>
  20. <tr>
  21. <th colspan="6">
  22. <%= link_to(container, {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package") %>
  23. </th>
  24. </tr>
  25. <% end -%>
  26. <% container.attachments.each do |file| %>
  27. <tr class="file">
  28. <td class="filename"><%= link_to_attachment file, :title => file.description -%></td>
  29. <td class="created_on"><%= format_time(file.created_on) %></td>
  30. <td class="filesize"><%= number_to_human_size(file.filesize) %></td>
  31. <td class="downloads"><%= file.downloads %></td>
  32. <td class="digest"><%= file.digest_type %>: <%= file.digest %></td>
  33. <td class="buttons">
  34. <%= link_to_attachment file, class: 'icon-only icon-download', title: l(:button_download), download: true %>
  35. <%= link_to(l(:button_delete), attachment_path(file), :class => 'icon-only icon-del',
  36. :data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
  37. </td>
  38. </tr>
  39. <% end %>
  40. <% end %>
  41. </tbody>
  42. </table>
  43. </div>
  44. <% html_title(l(:label_attachment_plural)) -%>