From daa8eaa9aebcc284e2904d1258cbfdd78ea23876 Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Tue, 31 Aug 2010 15:12:58 +0000 Subject: Refactor: move method, ProjectsController#list_files to FilesController#index. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4051 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/files/index.html.erb | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 app/views/files/index.html.erb (limited to 'app/views/files') diff --git a/app/views/files/index.html.erb b/app/views/files/index.html.erb new file mode 100644 index 000000000..2b2e5e870 --- /dev/null +++ b/app/views/files/index.html.erb @@ -0,0 +1,46 @@ +
+<%= link_to_if_authorized l(:label_attachment_new), {:controller => 'projects', :action => 'add_file', :id => @project}, :class => 'icon icon-add' %> +
+ +

<%=l(:label_attachment_plural)%>

+ +<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %> + + + + <%= sort_header_tag('filename', :caption => l(:field_filename)) %> + <%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc') %> + <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc') %> + <%= sort_header_tag('downloads', :caption => l(:label_downloads_abbr), :default_order => 'desc') %> + + + + +<% @containers.each do |container| %> + <% next if container.attachments.empty? -%> + <% if container.is_a?(Version) -%> + + + + <% end -%> + <% container.attachments.each do |file| %> + "> + + + + + + + + <% end + reset_cycle %> +<% end %> + +
MD5
+ <%= link_to(h(container), {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package") %> +
<%= link_to_attachment file, :download => true, :title => file.description %><%= format_time(file.created_on) %><%= number_to_human_size(file.filesize) %><%= file.downloads %><%= file.digest %> + <%= link_to(image_tag('delete.png'), {:controller => 'attachments', :action => 'destroy', :id => file}, + :confirm => l(:text_are_you_sure), :method => :post) if delete_allowed %> +
+ +<% html_title(l(:label_attachment_plural)) -%> -- cgit v1.2.3