socialforge/app/views/users/_show_user_resource.html.erb

81 lines
3.7 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<script>
// $(document).ready(function(){
//// var popupHeight = $(".referenceResourcesPopup").outerHeight(true);
//// $(".referenceResourcesPopup").css("marginTop",-popupHeight/2);
//
//
// $(".resourcePopupClose").click(function(){
// $(".referenceResourcesPopup").css("display","none");
// });
// });
$(document).ready(function(){
$(".referenceTypeBlock").click(function(){
var activeBlock = $(".referenceResourceType").children(".referenceTypeActive");
activeBlock.removeClass("referenceTypeActive");
$(this).addClass("referenceTypeActive");
});
});
// 点击 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()
)
}
}
</script>
<!--<div class="referenceResourcesPopup">-->
<div>
<div class="referenceText">引用资源库资源</div>
</div>
<div>
<div class="referenceResourceType fl">
<a href="<%= user_resource_type_user_path(user)%>" class="referenceTypeBlock referenceTypeActive" data-remote="true" >资源库</a>
<a href="<%= user_resource_type_user_path(user,:type=>'2')%>" class="referenceTypeBlock" data-remote="true">课程资源</a>
<a href="<%= user_resource_type_user_path(user,:type=>'3')%>" class="referenceTypeBlock" data-remote="true">项目资源</a>
<a href="<%= user_resource_type_user_path(user,:type=>'5')%>" class="referenceTypeBlock" data-remote="true">用户资源</a>
<a href="<%= user_resource_type_user_path(user,:type=>'4')%>" class="referenceTypeBlock" data-remote="true">附件</a> </div>
<div class="fr">
<!--<form class="referenceSearchBox">-->
<%= form_tag(user_ref_resource_search_user_path(user),:method => 'get',:remote=>'true',:class=>'referenceSearchBox') do%>
<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">
<%= render :partial => 'homework_ref_resources_list' ,:locals=>{ :attachments => @attachments,:seleted_resources=>seleted_resources} %>
</div>
<div >
<ul class="wlist" id="resource_ref_pages" style="margin-top: 5px;margin-right: 20px">
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
</ul>
</div>
<div>
<a href="javascript:void(0);" onclick="$(this).parent().parent().submit();" class="db courseSendSubmit sendSourceText">确定</a>
<a href="javascript:void(0);" onclick="hideResource();" class="db courseSendCancel sendSourceText">取消</a>
</div>
<div class="cl"></div>
<% end %>
<!--</div>-->