76 lines
2.8 KiB
Plaintext
76 lines
2.8 KiB
Plaintext
<div id="muban_popup_box" style="width:424px;">
|
|
<div class="muban_popup_top">
|
|
<h3 class="fl">更换管理员</h3>
|
|
<a href="javascript:void(0);" class="muban_icons_close fr"></a>
|
|
<div class="cl"></div>
|
|
</div>
|
|
<div class="muban_popup_con clear">
|
|
<div class="mr10 ml10">
|
|
<div class="alert alert-orange mb10 mt10">
|
|
选择的成员将会成为新的管理员,您的角色将变更为“教师”
|
|
</div>
|
|
<div class="" style="border: 1px solid #ccc">
|
|
<input type="text" name="search" value="<%=@search %>" placeholder="支持姓名、邮箱、登录名搜索" class="subjectSearch" style="height: 32px; width: 380px; margin: 5px 7px 0 7px; border: 1px solid #e5e5e5;" />
|
|
<div class="cl"></div>
|
|
<%= form_tag(change_manager_course_path(@course), method: 'post', :remote => true, :class => "",:id => "change_manager_form") do %>
|
|
<div id="search_member_list" style="padding: 0 7px;">
|
|
<%=render :partial => 'courses/settings/search_teacher_list', :locals => {:members => nil} %>
|
|
</div>
|
|
<% end %>
|
|
<div class="cl"></div>
|
|
<div class="cl"></div>
|
|
</div>
|
|
<div class="mt10">
|
|
<span class="c_red none" id="add_members_notice"></span>
|
|
|
|
<a href="javascript:void(0);" class="fr sy_btn_blue" onclick="submit_add_members_form();">确定</a>
|
|
<a href="javascript:void(0);" class="fr sy_btn_grey mr10" onclick="hideModal();">取消</a>
|
|
<div class="cl"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
var lastSearchCondition = '';
|
|
var count = 0;
|
|
function search_mems(e){
|
|
if($(e.target).val().trim() == lastSearchCondition && lastSearchCondition != '')
|
|
{
|
|
return;
|
|
}
|
|
lastSearchCondition = $(e.target).val().trim();
|
|
$.ajax({
|
|
url: '<%= url_for(:controller => 'courses', :action => 'search_course_teacher_list', :id => @course.id) %>'+'?search='+ e.target.value,
|
|
type:'get'
|
|
});
|
|
}
|
|
|
|
function throttle(method,context,e){
|
|
clearTimeout(method.tId);
|
|
method.tId=setTimeout(function(){
|
|
method.call(context,e);
|
|
},500);
|
|
}
|
|
|
|
//查询项目
|
|
$("input[name='search']").on('input', function (e) {
|
|
throttle(search_mems,window,e);
|
|
});
|
|
|
|
$(document).ready(function(){
|
|
$.ajax({
|
|
url: '<%= url_for(:controller => 'courses', :action => 'search_course_teacher_list', :id => @course.id) %>',
|
|
type:'get'
|
|
});
|
|
});
|
|
|
|
function submit_add_members_form(){
|
|
if($("input[name='chooseteacher']:checked").length == 0) {
|
|
$("#add_members_notice").show();
|
|
$("#add_members_notice").html("请先选择成员");
|
|
} else{
|
|
$("#change_manager_form").submit();
|
|
hideModal();
|
|
}
|
|
}
|
|
</script> |