60 lines
2.6 KiB
Plaintext
60 lines
2.6 KiB
Plaintext
<div id="sy_popup_box" style="width:460px;">
|
|
<div class="sy_popup_top">
|
|
<h3 class="fl">欢迎加入班级</h3>
|
|
<a href="javascript:void(0);" class="sy_icons_close fr" onclick="hideModal()"></a>
|
|
<div class="cl"></div>
|
|
</div>
|
|
<div class="sy_popup_con">
|
|
<%= form_tag({:controller => 'courses', :action => 'join_course_multi_role'}, :remote => true, :method => :post, :id => 'new-watcher-form') do %>
|
|
<ul class="sy_popup_add ">
|
|
<li>
|
|
<label>班级邀请码:</label>
|
|
<input class=" sy_input_txt fl" name="invite_code" placeholder="请输入五位班级邀请码">
|
|
<div class="cl"></div>
|
|
</li>
|
|
<li>
|
|
<label>身份:</label>
|
|
<input type="checkbox" name="role[]" value="9" id="join_course_role_9" class="ml5 mr5 "/><span class="mr10">教师</span>
|
|
<input type="checkbox" name="role[]" value="7" id="join_course_role_7" class="ml5 mr5"/><span class="mr10">助教</span>
|
|
<input type="checkbox" name="role[]" value="10" id="join_course_role_10" class="ml5 mr5"/><span class="mr10">学生</span>
|
|
<div class="cl"></div>
|
|
</li>
|
|
<p id="none_checked_notice" class="c_red none f12" style="margin-left: 42px;">请至少选择一个身份</p>
|
|
<li class="mt10">
|
|
<label> </label>
|
|
<a href="javascript:void(0);" class="sy_btn_blue fl" onclick="submit_join_course();">确 定</a>
|
|
<a href="javascript:void(0);" class="sy_btn_grey fl ml20" onclick="hideModal()">取 消</a>
|
|
<div class="cl"></div>
|
|
</li>
|
|
</ul>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
function submit_join_course(){
|
|
if ($("input[name='role[]']:checked").length >= 1){
|
|
$("#none_checked_notice").hide();
|
|
$('#new-watcher-form').submit();
|
|
hideModal();
|
|
}else{
|
|
$("#none_checked_notice").show();
|
|
}
|
|
}
|
|
|
|
$(function() {
|
|
$("#join_course_role_7").on('click', function(){
|
|
if($("#join_course_role_7").is(":checked")) {
|
|
$("#join_course_role_9").attr('disabled', 'disabled');
|
|
} else {
|
|
$("#join_course_role_9").removeAttr('disabled');
|
|
}
|
|
});
|
|
$("#join_course_role_9").on('click', function(){
|
|
if($("#join_course_role_9").is(":checked")) {
|
|
$("#join_course_role_7").attr('disabled', 'disabled');
|
|
} else {
|
|
$("#join_course_role_7").removeAttr('disabled');
|
|
}
|
|
});
|
|
});
|
|
</script> |