<% attachmenttypes = @course.attachmenttypes %> <% sufixtypes = @course.contenttypes %> <% delete_allowed = User.current.allowed_to?(:manage_files, @course) %> <%= stylesheet_link_tag 'resource', :media => 'all' %>

共有 <%= User.current.member_of_course?(@course) ? @all_attachments.count : 0 %> 个资源

按 时间 / 下载次数 / 引用次数 排序

<% @curse_attachments.each do |file| %> <%if file.is_public == 0 && !User.current.member_of_course?(@course)%> <%next%> <%end%>
<%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %> 选入我的课程 <%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open",:method => :post %>

文件大小:<%= number_to_human_size(file.filesize) %>

<%= link_to( l(:button_delete), attachment_path(file), :data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "f_r re_de") if delete_allowed %>

<%= time_tag(file.created_on).html_safe %><%= l(:label_bids_published_ago) %>  |  下载<%= file.downloads %>  |  引用0

<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6"} %> <%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6"} %>
<% end %>
    <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
<%= t(:label_user_course) %>资源共享区
<%#= link_to(l(:label_attachment_new), 'javascript:void(0);', :onclick=>"$('#file_buttons').slideToggle();", :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @course) %>
<%= link_to(l(:label_upload_files), 'javascript:void(0);', :class => 'icon m5p5 button_submit', :onclick => "$('#relation_file_div').slideUp();$('#upload_file_div').slideToggle('slow');") if User.current.allowed_to?(:manage_files, @course) %> <%= link_to(l(:label_relation_files), 'javascript:void(0);', :onclick => "$('#upload_file_div').slideUp();$('#relation_file_div').slideToggle();", :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @course) %>

<% if attachmenttypes.any? %>       <%= select_tag "attachment_browse", content_tag(:option, l(:attachment_all), :value => '0' ) +options_from_collection_for_select(attachmenttypes, "id", "typeName", params[:type]), :onchange => "course_attachmenttypes_searchex(this.value)" %> <% end %> <% if sufixtypes.any? %>   <%= select_tag "attach_sufix_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_for_select(sufixtypes), :onchange => "course_attachment_contenttypes_searchex(this.value)" %> <% end %>
<%= javascript_tag "observeSearchfield('attach_search', null, '#{ escape_javascript attachments_autocomplete_path(:course_id => @course.id, :format => 'js') }')" %> <% delete_allowed = User.current.allowed_to?(:manage_files, @course) %>
<%#= render :partial => 'course_show_all_attachment' %> <% if (@attachtype==0 && @contenttype=='0') || (@attachtype.nil? && @contenttype.nil?) %> <%= render partial: "course_show_all_attachment"%> <%else%> <%= render partial: "course_sort_by_attachtypel"%> <%end%>
<% html_title(l(:label_attachment_plural)) -%>