annotate .svn/pristine/b6/b6a2a69382c779cf0cb5b9cf78c2974d34b88329.svn-base @ 1519:afce8026aaeb redmine-2.4-integration

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