76 lines
4.9 KiB
Plaintext
76 lines
4.9 KiB
Plaintext
<script>
|
|
$(document).ready(function(){
|
|
<% if type == "1" %>
|
|
$("#my_resources_choose").addClass("choose-active");
|
|
$("#public_resources_choose").removeClass("choose-active");
|
|
<% end %>
|
|
|
|
$(".subject-choose").click(function(){
|
|
$(".subject-choose").removeClass("choose-active");
|
|
$(this).addClass("choose-active");
|
|
});
|
|
$(".popupClose").click(function(){
|
|
$(".popupWrap").hide();
|
|
});
|
|
});
|
|
</script>
|
|
<div class="f16 fb fontBlue mb10">选用资源库中的资源</div>
|
|
<div class="subjectList fl mr10">
|
|
<% if !params[:course_id].nil? %>
|
|
<a href="<%= import_resources_user_path(User.current, :type => '6', :course_id => params[:course_id]) %>" id="public_resources_choose" class="subject-choose choose-active fl" data-remote="true">公共资源</a>
|
|
<a href="<%= import_resources_user_path(User.current, :type => '1', :course_id => params[:course_id]) %>" id="my_resources_choose" class="subject-choose fl" data-remote="true">我的资源</a>
|
|
<% elsif !params[:project_id].nil? %>
|
|
<a href="<%= import_resources_user_path(User.current, :type => '6', :project_id => params[:project_id]) %>" id="public_resources_choose" class="subject-choose choose-active fl" data-remote="true">公共资源</a>
|
|
<a href="<%= import_resources_user_path(User.current, :type => '1', :project_id => params[:project_id]) %>" id="my_resources_choose" class="subject-choose fl" data-remote="true">我的资源</a>
|
|
<% elsif !params[:subfield_file_id].nil? %>
|
|
<a href="<%= import_resources_user_path(User.current, :type => '6', :subfield_file_id => params[:subfield_file_id]) %>" id="public_resources_choose" class="subject-choose choose-active fl" data-remote="true">公共资源</a>
|
|
<a href="<%= import_resources_user_path(User.current, :type => '1', :subfield_file_id => params[:subfield_file_id]) %>" id="my_resources_choose" class="subject-choose fl" data-remote="true">我的资源</a>
|
|
<% end %>
|
|
<%#= form_tag( url_for(:controller => 'users', :action => 'import_resources_search', :id => User.current.id, :type => 1),
|
|
:remote => true , :method => 'get', :id => 'resource_search_form') do %>
|
|
<!--<input type="text" name="search" placeholder="输入资源关键词进行搜索" class="subjectSearch fr" />-->
|
|
<%#= hidden_field_tag(:type,type.nil? ? 1 : type) %>
|
|
<%# end %>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div style="height:441px; min-height:441px; max-height:441px;">
|
|
<ul class="subjectBanner mt10">
|
|
<li class="subjectName fl hidden"><span style="padding-left:15px;">资源名称</span></li>
|
|
<li class="subjectType fl">类别</li>
|
|
<li class="subjectCount fl">大小</li>
|
|
<li class="subjectPublisher fl">上传者</li>
|
|
<li class="fl subjectDate">上传时间</li>
|
|
</ul>
|
|
<%= form_tag( url_for({:controller => 'users', :action => 'import_into_container',
|
|
:mul_id => params[:project_id].nil? ? (params[:course_id].nil? ? params[:subfield_file_id] : params[:course_id]) : params[:project_id],
|
|
:mul_type => params[:project_id].nil? ? (params[:course_id].nil? ? "SubfieldFile" : "Course") : "Project"}),
|
|
:method => 'post', :id => 'resource_import_container_form') do %>
|
|
<% @attachments.each do |attach| %>
|
|
<ul class="subjectRow">
|
|
<li class="subjectName fl hidden">
|
|
<label>
|
|
<input name="checkbox1[]" type="checkbox" data-has-history="<%= attach.attachment_histories.count == 0 ? 'N' : 'Y' %>" data-deleteble="<%= User.current.id ==attach.author_id ? 'Y' : 'N' %>" onclick="checkAllBox($(this));" value="<%= attach.id%>" class="mr5" style="vertical-align:middle;" />
|
|
<span><%= link_to truncate(attach.filename, :length => 30), download_named_attachment_path(attach.id, attach.filename), :title => attach.filename%></span>
|
|
</label>
|
|
</li>
|
|
<li class="subjectType fl"><%= get_resource_type(attach.container_type)%></li>
|
|
<li class="subjectCount fl hidden"><%= number_to_human_size(attach.filesize) %></li>
|
|
<li class="subjectPublisher fl"><%=User.find(attach.author_id).realname.blank? ? User.find(attach.author_id).nickname : User.find(attach.author_id).realname %></li>
|
|
<li class="fl subjectDate"><%= format_date(attach.created_on) %></li>
|
|
</ul>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sendSourceText" onclick="$('#resource_import_container_form').submit();hideModal()">选用</a></div>
|
|
<div class="courseSendCancel"><a href="javascript:void(0);" class="sendSourceText" onclick="hideModal()">取消</a></div>
|
|
|
|
<div class="pageRoll mt0">
|
|
<ul class="wlist" id="pages" style="margin-top: 5px;">
|
|
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
|
|
</ul>
|
|
</div>
|
|
<div class="cl"></div>
|
|
</div>
|