2014-11-21 11:38:53 +08:00
|
|
|
<% delete_allowed = User.current.allowed_to?(:manage_files, course) %>
|
|
|
|
<div class="re_con_top">
|
2014-11-22 13:45:17 +08:00
|
|
|
<p class="f_l c_blue f_b f_14">共有 <%= all_attachments.count%> 个资源</p>
|
2014-11-22 10:06:56 +08:00
|
|
|
<p class="f_r" style="color: #808080">
|
|
|
|
<!--<#% if @order == "asc" %>
|
2014-11-21 11:38:53 +08:00
|
|
|
按 <#%= link_to "时间",course_files_path(course,:sort=>"created_on:desc"),:class => "f_b c_grey" %><#%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"created_on"} %> /
|
|
|
|
<#%= link_to "下载次数",course_files_path(course,:sort=>"downloads:desc"),:class => "f_b c_grey" %><#%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"downloads"} %> /
|
|
|
|
<a href="#" class="f_b c_grey">引用次数</a> 排序
|
|
|
|
<#%else%>
|
|
|
|
按 <#%= link_to "时间",course_files_path(course,:sort=>"created_on:asc"),:class => "f_b c_grey" %><#%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"created_on"} %> /
|
|
|
|
<#%= link_to "下载次数",course_files_path(course,:sort=>"downloads:asc"),:class => "f_b c_grey" %><#%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"downloads"} %> /
|
|
|
|
<a href="#" class="f_b c_grey">引用次数</a> 排序
|
2014-11-22 10:06:56 +08:00
|
|
|
<#% end %>-->
|
|
|
|
资源列表的多样化排序将在下周上线...
|
|
|
|
</p>
|
2014-11-21 11:38:53 +08:00
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<% curse_attachments.each do |file| %>
|
|
|
|
<div class="re_con_box">
|
|
|
|
<div class=" ">
|
2014-11-21 15:35:08 +08:00
|
|
|
<%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :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" %>
|
2014-11-22 13:45:17 +08:00
|
|
|
<% if User.current.logged? %>
|
|
|
|
<% if is_course_teacher(User.current,@course) && file.author_id == User.current.id %>
|
2014-11-24 14:39:31 +08:00
|
|
|
<%= link_to("选入我的其他课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select",:remote => true) if has_course?(User.current) %>
|
2014-11-22 13:45:17 +08:00
|
|
|
|
2014-11-21 15:23:54 +08:00
|
|
|
<% if delete_allowed && file.container_id == @course.id && file.container_type == "Course" %>
|
|
|
|
<span id="is_public_<%= file.id %>">
|
|
|
|
<%= 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 %>
|
|
|
|
</span>
|
|
|
|
<% else %>
|
2014-11-22 13:45:17 +08:00
|
|
|
<!-- <#%= link_to (file.is_public? ? "公开":"私有"),"javascript:void(0)",:class=>"f_l re_open" %> -->
|
2014-11-21 15:23:54 +08:00
|
|
|
<% end %>
|
2014-11-22 13:45:17 +08:00
|
|
|
<% else %>
|
2014-11-24 14:39:31 +08:00
|
|
|
<%= link_to("选入我的课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select",:remote => true) if has_course?(User.current) %>
|
2014-11-22 13:45:17 +08:00
|
|
|
<% end %>
|
2014-11-21 11:38:53 +08:00
|
|
|
<% else %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="">
|
2014-11-21 17:06:58 +08:00
|
|
|
<p class="f_l c_grey02 font">文件大小:<%= number_to_human_size(file.filesize) %></p>
|
2014-11-21 11:38:53 +08:00
|
|
|
<%= link_to( l(:button_delete), attachment_path(file),
|
2014-11-21 15:02:34 +08:00
|
|
|
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "f_r re_de") if delete_allowed && file.container_id == @course.id && file.container_type == "Course"%>
|
2014-11-26 15:26:57 +08:00
|
|
|
<p class="f_r c_grey02" ><%= time_tag(file.created_on).html_safe %><%= l(:label_bids_published_ago) %> | 下载<%= file.downloads %> | 引用<%= get_qute_number file %> </p>
|
2014-11-21 11:38:53 +08:00
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="tag_h">
|
|
|
|
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6"} %>
|
|
|
|
<%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6"} %>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
</div><!---re_con_box end-->
|
|
|
|
<% end %>
|
|
|
|
<ul class="wlist">
|
|
|
|
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
|
|
|
|
</ul>
|
|
|
|
<div class="cl"></div>
|