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>
|
2015-05-20 11:56:34 +08:00
|
|
|
<p class="f_r" style="color: #808080">
|
2014-11-28 11:33:51 +08:00
|
|
|
<% if order == "asc" %>
|
2015-05-20 11:56:34 +08:00
|
|
|
按 <%= link_to "时间",params.merge(:sort=>"created_on:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"created_on"} %> /
|
|
|
|
<%= link_to "下载次数",params.merge(:sort=>"downloads:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"downloads"} %> /
|
|
|
|
<%= link_to "引用次数",params.merge(:sort=>"quotes:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"quotes"} %> 排序
|
2014-11-28 11:33:51 +08:00
|
|
|
<% else %>
|
|
|
|
按 <%= link_to "时间",params.merge(:sort=>"created_on:asc"),:class => "f_b c_grey" ,:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"created_on"} %> /
|
2014-12-02 15:30:32 +08:00
|
|
|
<%= link_to "下载次数",params.merge(:sort=>"downloads:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"downloads"} %> /
|
2015-05-20 11:56:34 +08:00
|
|
|
<%= link_to "引用次数",params.merge(:sort=>"quotes:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"quotes"} %> 排序
|
2014-11-28 11:33:51 +08:00
|
|
|
<% end %>
|
2014-11-22 10:06:56 +08:00
|
|
|
</p>
|
2014-11-21 11:38:53 +08:00
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
2015-04-15 14:53:07 +08:00
|
|
|
|
2015-04-16 14:01:58 +08:00
|
|
|
<div class="files_tag" id="files_tag">
|
2015-05-20 11:56:34 +08:00
|
|
|
<%= render :partial => "files/tag_yun", :locals => {:tag_list => @tag_list,:course => course,:tag_name => @tag_name}%>
|
2015-04-15 14:53:07 +08:00
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
2015-03-20 17:26:31 +08:00
|
|
|
<div class="for_img_thumbnails">
|
2015-05-20 11:56:34 +08:00
|
|
|
<% curse_attachments.each do |file| %>
|
|
|
|
<% if file.is_public? || User.current.member_of_course?(course) %>
|
|
|
|
<div class="re_con_box" id="container_files_<%= file.id %>">
|
|
|
|
<div class="">
|
2015-06-26 09:47:58 +08:00
|
|
|
<%= link_to truncate(file.filename,length: 35, omission: '...'),
|
2015-06-18 09:13:20 +08:00
|
|
|
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 => "c_dblue f_14 f_b f_l" %>
|
2015-05-20 11:56:34 +08:00
|
|
|
<% if User.current.logged? %>
|
|
|
|
<% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %>
|
|
|
|
<%= link_to("选入我的其他课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %>
|
2014-11-22 13:45:17 +08:00
|
|
|
|
2015-05-20 11:56:34 +08:00
|
|
|
<% if delete_allowed && file.container_id == @course.id && file.container_type == "Course" %>
|
2015-06-04 13:55:38 +08:00
|
|
|
<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 c_blue",:method => :post %>
|
|
|
|
</span>
|
2015-05-20 11:56:34 +08:00
|
|
|
<% else %>
|
|
|
|
<!-- <#%= link_to (file.is_public? ? "公开":"私有"),"javascript:void(0)",:class=>"f_l re_open" %> -->
|
|
|
|
<% end %>
|
|
|
|
<% else %>
|
|
|
|
<%= link_to("选入我的课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %>
|
|
|
|
<% end %>
|
2015-06-18 09:13:20 +08:00
|
|
|
<%= file_preview_tag(file, class: 'f_l re_open') %>
|
2015-05-20 11:56:34 +08:00
|
|
|
<% else %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
2015-06-04 10:56:49 +08:00
|
|
|
<div class="mt5">
|
2015-05-20 11:56:34 +08:00
|
|
|
<p class="f_l mb5 c_grey02">文件大小:<%= number_to_human_size(file.filesize) %></p>
|
|
|
|
<%= 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 && file.container_id == @course.id && file.container_type == "Course"%>
|
|
|
|
<p class="f_r c_grey02" ><%= time_tag(file.created_on).html_safe %><%= l(:label_bids_published_ago) %> | 下载<%= file.downloads %> | 引用<%= file.quotes.nil? ? 0:file.quotes %> </p>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="tag_h">
|
|
|
|
<%= 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} %>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
</div><!---re_con_box end-->
|
|
|
|
<% else %>
|
|
|
|
<div class="re_con_box"><span class='fr mr10 pr_join_span '><%= file.filename %>是私有资源</span></div>
|
|
|
|
<% end %>
|
2015-04-03 11:30:48 +08:00
|
|
|
<% end %>
|
2015-03-20 17:26:31 +08:00
|
|
|
</div>
|
2014-11-21 11:38:53 +08:00
|
|
|
<ul class="wlist">
|
|
|
|
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
|
|
|
|
</ul>
|
2015-06-04 10:26:35 +08:00
|
|
|
<div class="cl"></div>
|