annotate app/views/files/index.html.erb @ 1516:b450a9d58aed redmine-2.4

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