chris@22:
chris@37: <%= 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:
chris@22: chris@22:

<%=l(:label_attachment_plural)%>

chris@22: chris@22: <% delete_allowed = User.current.allowed_to?(:manage_files, @project) %> chris@255: <% active_change_allowed = delete_allowed %> chris@22: chris@22: chris@22: chris@256: <%= sort_header_tag('active', :caption => l(:field_active)) %> chris@22: <%= sort_header_tag('filename', :caption => l(:field_filename)) %> chris@22: <%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc') %> chris@22: <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc') %> chris@255: <%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc') %> chris@22: chris@22: chris@22: chris@22: chris@260: <% have_file = false %> Chris@909: <% @containers.each do |container| %> chris@22: <% next if container.attachments.empty? -%> Chris@909: <% if container.is_a?(Version) -%> chris@22: chris@255: Chris@909: Chris@909: <% end -%> Chris@909: <% container.attachments.each do |file| %> chris@269: <%= "active" if file.active? %>"> chris@257: chris@269: <% if file.active? %> chris@269: chris@269: <% else %> chris@269: chris@22: chris@22: chris@22: chris@22: chris@22: Chris@909: chris@22: <% end chris@22: reset_cycle %> chris@22: <% end %> chris@22: chris@22:
MD5
Chris@909: <%= link_to(h(container), {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package") %> Chris@909:
chris@260: <% have_file = true %> chris@257: <% if active_change_allowed chris@257: active_id = "active-" + file.id.to_s -%> chris@257:
chris@1154: <%= link_to image_tag(file.active? ? 'fav.png' : 'fav_off.png'), chris@1154: {:controller => 'attachments', :action => 'toggle_active', :project_id => @project.id, :id => file}, chris@1154: :remote => true chris@257: %> chris@257:
chris@257: <% else -%> chris@257: <%= image_tag('fav.png') if file.active? %> chris@257: <% end -%> chris@257:
<%= link_to_attachment file, :download => true %>
<%= h(file.description) %>
<%= link_to_attachment file, :download => true, :title => file.description %> chris@269: <% end %> chris@269: <%= format_time(file.created_on) %><%= number_to_human_size(file.filesize) %><%= file.downloads %><%= file.digest %> Chris@909: <%= link_to(image_tag('delete.png'), attachment_path(file), Chris@1115: :data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %> chris@22:
chris@22: chris@1154: <%= l(:text_files_active_change).html_safe if active_change_allowed and have_file %> chris@257: chris@22: <% html_title(l(:label_attachment_plural)) -%>