<% delete_allowed = User.current.allowed_to?(:manage_files, course) %> <% curse_attachments.each do |file| %> <% if file.is_public? || User.current.member_of_course?(course) || User.current.admin? %>
<%= link_to image_tag(url_to_avatar(file.author), :width => 50, :height => 50), user_path(file.author) %>
<%= link_to truncate(file.filename,length: 35, omission: '...'), download_named_attachment_path(file.id, file.filename), :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkBlue f_14 f_b" %> <%= file_preview_eye(file, class: 'preview') %> <% if file.is_public? == false%> 私有 <%end %>
上传时间:<%= format_time(file.created_on)%> <% if file.tag_list.length > 0%> 上传类型:<%= file.tag_list[0] %> <% end %>

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

下载<%= file.downloads%>  |  引用<%= file.quotes.nil? ? 0:file.quotes %>

<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %> <%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
  • <% if User.current.logged? %> <% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %> <% if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" %>
    • <%= link_to("发       送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}')") %>
    • <%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %>
    • <% if @course.is_public? %>
    • <%= link_to (file.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"postOptionLink",:method => :post %>
    • <%end%>
    • <%= link_to( '删除资源', attachment_path(file), :data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "postOptionLink") if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" && file.destroyable %>
    <% end %> <%else%>
    • <%= link_to("发  送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}')") %>
    <% end %> <% end %>
<% else %>
<%= file.filename %>是私有资源
<% end %> <% end %> <% if curse_attachments.count == 10%> <% if params[:action] == 'search' %> <%=link_to "点击展开更多", search_course_files_path({:course_id => course.id,:page => @obj_pages.nil? ? @feedback_pages.page + 1 : @obj_pages.page + 1}.merge(params)),:id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %> <% else %> <%=link_to "点击展开更多", course_files_path(:course_id => course.id, :page => @page), :id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %> <%end%> <% end%>