2015-11-26 16:29:50 +08:00
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
|
<link href="css/public.css" rel="stylesheet" type="text/css" />
|
|
|
|
<link href="css/org.css" rel="stylesheet" type="text/css" />
|
|
|
|
<script src="js/jquery-1.3.2.js" type="text/javascript"></script>
|
|
|
|
<script type="text/javascript" src="js/bootstrap.js"></script>
|
|
|
|
<script>
|
|
|
|
$(document).ready(function(){
|
|
|
|
var popupHeight = $(".resourceSharePopup").outerHeight(true);
|
|
|
|
$(".resourceSharePopup").css("marginTop",-popupHeight/2);
|
|
|
|
|
|
|
|
|
|
|
|
$(".resourcePopupClose").click(function(){
|
2015-11-27 17:27:55 +08:00
|
|
|
location.reload();
|
2015-11-26 16:29:50 +08:00
|
|
|
$(".resourceSharePopup").css("display","none");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
2015-12-07 12:53:51 +08:00
|
|
|
<!--<div class="resourceSharePopup">-->
|
2015-11-26 16:29:50 +08:00
|
|
|
<div>
|
|
|
|
<div class="relateText fl">请选择关联到组织的课程</div>
|
|
|
|
</div>
|
|
|
|
<div class="fl">
|
|
|
|
<%=form_tag url_for(:controller => 'organizations', :action => 'join_courses', :organization_id => organization_id),:method => 'post', :id => 'join_courses_form', :remote => true,:class=>"resourcesSearchBox" do %>
|
2015-11-27 09:50:17 +08:00
|
|
|
<input type="text" name="courses" placeholder="搜索您已加入的课程的名称" class="searchCourse" />
|
|
|
|
<div id="search_courses_result_list" class="mb8"></div>
|
2015-11-26 16:29:50 +08:00
|
|
|
<div class="courseSendSubmit">
|
|
|
|
<a href="javascript:void(0);" onclick="org_join_courses(<%= organization_id %>);" class="sendSourceText">关联</a>
|
|
|
|
</div>
|
2015-12-15 10:47:35 +08:00
|
|
|
<div class="courseSendCancel"><a href="javascript:void(0);" onclick="hideModal();" class="sendSourceText">取消</a></div>
|
2015-11-26 16:29:50 +08:00
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
2015-12-07 12:53:51 +08:00
|
|
|
<!--</div>-->
|
2015-11-26 16:29:50 +08:00
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
var lastSearchCondition = '';
|
|
|
|
var page = 1;
|
|
|
|
var count = 0;
|
|
|
|
var maxPage = 0;
|
|
|
|
function search_courses(e){
|
|
|
|
if($(e.target).val().trim() == lastSearchCondition && lastSearchCondition != '')
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
lastSearchCondition = $(e.target).val().trim();
|
|
|
|
$.ajax({
|
|
|
|
url: '<%= url_for(:controller => 'organizations', :action => 'search_courses') %>'+'?name='+ e.target.value,
|
|
|
|
type:'get'
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function throttle(method,context,e){
|
|
|
|
clearTimeout(method.tId);
|
|
|
|
method.tId=setTimeout(function(){
|
|
|
|
method.call(context,e);
|
|
|
|
},500);
|
|
|
|
}
|
|
|
|
|
|
|
|
//查询组织
|
|
|
|
$("input[name='courses']").on('input', function (e) {
|
|
|
|
throttle(search_courses,window,e);
|
|
|
|
});
|
|
|
|
|
|
|
|
$(document).ready(function(){
|
|
|
|
$.ajax({
|
|
|
|
url: '<%= url_for(:controller => 'organizations', :action => 'search_courses') %>',
|
|
|
|
type:'get'
|
|
|
|
});
|
|
|
|
});
|
|
|
|
function cancel_join_courses() {
|
2015-11-27 10:43:21 +08:00
|
|
|
$("#join_courses_form input:checked").attr("checked", false);
|
|
|
|
//$("#search_courses_result_list").html("");
|
2015-11-26 16:29:50 +08:00
|
|
|
}
|
|
|
|
function org_join_courses(orgId) {
|
|
|
|
$.ajax({
|
|
|
|
url: "/organizations/"+orgId + "/join_courses?" + $("#join_courses_form").serialize(),
|
|
|
|
type: "post",
|
|
|
|
success: function (data) {
|
2015-12-18 14:30:25 +08:00
|
|
|
// $.ajax({
|
|
|
|
// url: "/organizations/" + orgId + "/search_courses?name=" + $("input[name='courses']").val().trim(),
|
|
|
|
// type: "get"
|
|
|
|
// });
|
2015-11-26 16:29:50 +08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|