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

97 lines
5.4 KiB
Plaintext

<%= stylesheet_link_tag 'pleft','header','new_user','repository','org', 'public' %>
<script>
$(document).ready(function(){
$(".resource-switch").click(function(){
$(".resource-switch").children().removeClass("resource-tab-active");
$(this).children().addClass("resource-tab-active");
});
$("input[name='subject-list-name']").click(function(){
if($("input[name='subject-list-name']:checked").length >= 1){
$(".resourcesSelectSendButton").removeClass("inactive-border");
$(".sendButtonBlue").removeClass("inactive-text");
}else {
$(".resourcesSelectSendButton").addClass("inactive-border");
$(".sendButtonBlue").addClass("inactive-text");
}
});
});
function choose_course(user_id) {
var check = $('input[name="checkMenu"]:checked');
if(check.length == 0) {
$("#choose_homework_notice").text("请先选择一个作业");
} else {
var hw_id = $('input[name="checkMenu"]:checked').val();
$("#choose_homework_notice").text("");
$.ajax({
type: 'get',
url: '/users/' + user_id + '/choose_user_course?homework='+hw_id,
data:{send_id:$('input[name="checkMenu"]:checked').val()}
});
}
}
</script>
<div class="homepageContentContainer">
<div class="homepageContent">
<div class="resource-wrapper mt10">
<ul class="resource-banner">
<li class="fl resource-switch">
<a href="<%= user_homework_type_user_path(@user,:is_import => 0) %>" id="public_homeworks_choose" class="resource-tab resource-tab-active" data-remote="true">公共题库</a>
</li>
<li class="fl resource-switch">
<a href="<%= user_homework_type_user_path(@user,:type=>'2',:is_import => 0) %>" id="user_homeworks_choose" class="resource-tab" data-remote="true">我的题库</a>
</li>
<li class="fl w770 border-bottom h34">&nbsp;</li>
<li class="fr resource-banner-li border-bottom h34">
<ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="resourcesType">
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 0) %>" id="homework_type_all" class="resourcesTypeAll resourcesGrey" data-method="get" data-remote="true">全部</a> </li>
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 1) %>" id="homework_type_nor" class="homepagePostTypeAssignment postTypeGrey" data-method="get" data-remote="true">普通作业</a> </li>
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 2) %>" id="homework_type_pro" class="program-btn postTypeGrey" data-method="get" data-remote="true" style="white-space:nowrap;">编程作业</a> </li>
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 3) %>" id="homework_type_gro" class="group-btn resourcesGrey" data-method="get" data-remote="true">分组作业</a> </li>
</ul>
</li>
</ul>
</li>
<div class="cl"></div>
</ul>
<div class="cl"></div>
<div id="homework_search_input" class="mt10 fl">
<%=render :partial=>'homework_repository_search', :locals=>{:type => @type,:is_import => 0,:property => @property} %>
</div>
<!--<form class="resourcesSearchloadBox mt10">
<input type="text" name="serach" placeholder="输入题库关键词进行搜索" class="searchResource" />
<a href="javascript:void(0);" class="homepageSearchIcon"></a>
</form>-->
<div class="cl"></div>
<div class="w583 fl mr10 mt10">
<ul class="subject-list-banner">
<li class="subject-list-name fl hidden"><span style="padding-left:15px;">作业名称</span></li>
<li class="subject-list-from fl">来源</li>
<li class="subject-list-type fl">类别</li>
<li class="subject-list-publisher fl">贡献者</li>
<li class="subject-list-count fl">引用数</li>
<li class="fl subject-list-date">发布时间</li>
</ul>
<div id="homework_repository">
<%=render :partial => 'homework_repository', :locals => {:homeworks => @homeworks} %>
</div>
</div>
<div id="homework_repository_detail">
<%=render :partial => 'homework_repository_detail', :locals => {:homework => nil} %>
</div>
<div class="cl"></div>
<div>
<ul class="wlist mt10" id="homework_pository_ref_pages" style="margin-top: 5px;margin-right: 395px">
<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
</ul>
</div>
<div class="fl resourcesSelectSendButton mr15 inactive-border mt10">
<a href="javascript:void(0)" onclick="choose_course('<%=User.current.id %>');" class="sendButtonBlue db inactive-text" data-remote="true">发送至</a>
</div>
<span class="c_red fl mt15" id="choose_homework_notice"></span>
</div>
</div>
</div>
</div>