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 1.8KB

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