2015-09-01 11:29:43 +08:00
|
|
|
|
<script>
|
|
|
|
|
// $(document).ready(function(){
|
|
|
|
|
//// var popupHeight = $(".referenceResourcesPopup").outerHeight(true);
|
|
|
|
|
//// $(".referenceResourcesPopup").css("marginTop",-popupHeight/2);
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// $(".resourcePopupClose").click(function(){
|
|
|
|
|
// $(".referenceResourcesPopup").css("display","none");
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
$(document).ready(function(){
|
2016-05-24 16:01:02 +08:00
|
|
|
|
<% if type == "1" %>
|
|
|
|
|
$("#my_resources_choose_homework").addClass("referenceTypeActive");
|
|
|
|
|
$("#public_resources_choose_homework").removeClass("referenceTypeActive");
|
|
|
|
|
<% else %>
|
2015-09-01 11:29:43 +08:00
|
|
|
|
$(".referenceTypeBlock").click(function(){
|
|
|
|
|
var activeBlock = $(".referenceResourceType").children(".referenceTypeActive");
|
|
|
|
|
activeBlock.removeClass("referenceTypeActive");
|
|
|
|
|
$(this).addClass("referenceTypeActive");
|
|
|
|
|
});
|
2016-05-24 16:01:02 +08:00
|
|
|
|
<% end %>
|
2015-09-01 11:29:43 +08:00
|
|
|
|
});
|
2015-10-24 10:47:04 +08:00
|
|
|
|
|
|
|
|
|
// 点击 checkbox选中引用的资源的时候,保存该资源的id到session里去
|
|
|
|
|
function store_seleted_resource(dom){
|
|
|
|
|
if(dom.attr('checked') == 'checked' ){
|
|
|
|
|
$.get(
|
|
|
|
|
'<%= store_selected_resource_user_path %>'+'?save=y&res_id='+dom.val()
|
|
|
|
|
)
|
|
|
|
|
}else {
|
|
|
|
|
$.get(
|
|
|
|
|
'<%= store_selected_resource_user_path %>'+'?save=n&res_id='+dom.val()
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-09-01 11:29:43 +08:00
|
|
|
|
</script>
|
|
|
|
|
<!--<div class="referenceResourcesPopup">-->
|
2015-08-28 16:47:43 +08:00
|
|
|
|
<div>
|
2015-09-01 11:29:43 +08:00
|
|
|
|
<div class="referenceText">引用资源库资源</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<div class="referenceResourceType fl">
|
2016-05-24 16:01:02 +08:00
|
|
|
|
<a href="<%= user_ref_resource_search_user_path(User.current, :type => '6') %>" id="public_resources_choose_homework" class="referenceTypeBlock referenceTypeActive" data-remote="true">公共资源</a>
|
|
|
|
|
<a href="<%= user_ref_resource_search_user_path(User.current, :type => '1') %>" id="my_resources_choose_homework" class="referenceTypeBlock" data-remote="true">我的资源</a>
|
|
|
|
|
</div>
|
2015-09-01 11:29:43 +08:00
|
|
|
|
<div class="fr">
|
|
|
|
|
<!--<form class="referenceSearchBox">-->
|
2016-05-24 16:01:02 +08:00
|
|
|
|
<%= form_tag(user_ref_resource_search_user_path(user, :type => @type),:method => 'get',:remote=>'true',:class=>'referenceSearchBox') do%>
|
2015-09-01 11:29:43 +08:00
|
|
|
|
<input type="text" name="search" placeholder="输入资源关键词进行搜索" class="searchReferencePopup" />
|
|
|
|
|
<a href="javascript:void(0);" onclick="$(this).parent().submit();" class="referenceSearchIcon"></a>
|
|
|
|
|
<% end %>
|
|
|
|
|
<!--</form>-->
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="resourcesListBanner">
|
|
|
|
|
<ul class="resourcesListTab">
|
|
|
|
|
<li class="resourcesListCheckbox fl"> </li>
|
|
|
|
|
<li class="resourcesListName fl">资源名称</li>
|
|
|
|
|
<li class="resourcesListSize fl">大小</li>
|
|
|
|
|
<li class="resourcesListType fl">类别</li>
|
|
|
|
|
<li class="resourcesListUploader fl">上传者</li>
|
|
|
|
|
<li class="resourcesListTime fl">上传时间</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
<%= form_tag(import_resources_to_homework_user_path(user),:method => 'post',:remote=>'true') do %>
|
|
|
|
|
<input type="hidden" name="homework_id" value="<%= homework_id%>"/>
|
|
|
|
|
<div style="height: 300px" id="user_ref_resources">
|
2015-10-12 15:51:47 +08:00
|
|
|
|
<%= render :partial => 'homework_ref_resources_list' ,:locals=>{ :attachments => @attachments,:seleted_resources=>seleted_resources} %>
|
2015-08-28 16:47:43 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div >
|
2015-10-12 10:34:30 +08:00
|
|
|
|
<ul class="wlist" id="resource_ref_pages" style="margin-top: 5px;margin-right: 20px">
|
2015-09-01 11:29:43 +08:00
|
|
|
|
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
2015-09-16 09:45:27 +08:00
|
|
|
|
<a href="javascript:void(0);" onclick="$(this).parent().parent().submit();" class="db courseSendSubmit sendSourceText">确定</a>
|
2015-09-28 17:09:07 +08:00
|
|
|
|
<a href="javascript:void(0);" onclick="hideResource();" class="db courseSendCancel sendSourceText">取消</a>
|
2015-08-28 16:47:43 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
2015-09-01 11:29:43 +08:00
|
|
|
|
<% end %>
|
|
|
|
|
<!--</div>-->
|