2016-01-08 10:49:02 +08:00
|
|
|
|
<script type="text/javascript">
|
2016-02-26 17:44:46 +08:00
|
|
|
|
function submit_copy_course() {
|
|
|
|
|
if(regex_course_name()&®ex_course_class_period()&®ex_time_term()&®ex_course_password())
|
|
|
|
|
{
|
|
|
|
|
$("#new_course").submit();
|
|
|
|
|
document.getElementById("submit_copy_course").onclick = "";
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-01-08 10:49:02 +08:00
|
|
|
|
$(document).ready(function(){
|
|
|
|
|
$("#time").change(function(){
|
|
|
|
|
document.getElementById("end_time").options[document.getElementById("time").selectedIndex].selected = true;
|
|
|
|
|
});
|
|
|
|
|
$("#term").change(function(){
|
|
|
|
|
document.getElementById("end_term").options[document.getElementById("term").selectedIndex].selected = true;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var popupHeight = $(".referenceResourcesPopup").outerHeight(true);
|
|
|
|
|
$(".referenceResourcesPopup").css("marginTop",-popupHeight/2);
|
|
|
|
|
$(".resourcePopupClose").click(function(){
|
|
|
|
|
hideModal();
|
|
|
|
|
});
|
|
|
|
|
$("#copyResource").click(function(){
|
|
|
|
|
if ($("#allResource").is(":checked")){
|
|
|
|
|
$("input[name='course_attachment_type[]']").attr("checked",true);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
$("input[name='course_attachment_type[]']").attr("checked",false);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
$("#copyResource2").click(function(){
|
|
|
|
|
if ($("input[name='course_attachment_type[]']:checked").length == 6){
|
|
|
|
|
$("#allResource").attr("checked",true);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
$("#allResource").attr("checked",false);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
<div class="referenceText">信息配置</div>
|
|
|
|
|
</div>
|
|
|
|
|
<ul class="mt10">
|
|
|
|
|
<%=labelled_form_for @new_course do |f| %>
|
|
|
|
|
<input name="copy_course" value="<%=@course.id %>" style="display: none"/>
|
2016-01-08 21:22:36 +08:00
|
|
|
|
<li class="ml45 mb10">
|
|
|
|
|
<a href="javascript:void(0)" class="upimg fl">
|
2016-01-29 22:09:16 +08:00
|
|
|
|
<%= image_tag(url_to_avatar(@course), id: "avatar_image", :width =>"60", :height =>"60",:alt=>"上传图片")%>
|
2016-01-08 21:22:36 +08:00
|
|
|
|
</a> <!--<a href="javascript:void(0)" class="upbtn fl ml30" onclick="$('#upload_course_logo').click();">上传图片</a>-->
|
2016-01-08 10:49:02 +08:00
|
|
|
|
<!--</span>-->
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="ml45">
|
2016-01-29 22:09:16 +08:00
|
|
|
|
|
2016-01-08 10:49:02 +08:00
|
|
|
|
<input type="text" style="display: none"/> <!--阻止表单自动填充 -->
|
|
|
|
|
<input type="password" style="display: none"/> <!--阻止表单自动填充 -->
|
|
|
|
|
<label><span class="c_red">*</span> <%= l(:label_tags_course_name)%> :</label>
|
|
|
|
|
<input type="text" name="course[name]" id="course_name" class="courses_input grey_border" maxlength="100" onkeyup="regex_course_name();" value="<%=@course.name %>">
|
|
|
|
|
<span class="c_red" id="course_name_notice" style="display: none;">课程名称不能为空</span>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<li class="ml45">
|
|
|
|
|
<label><span class="c_red">*</span> <%= l(:label_class_period)%> :</label>
|
|
|
|
|
<input type="text" name="class_period" id="class_period" class="hwork_input02 grey_border" onkeyup="regex_course_class_period();" maxlength="6" value="<%=@course.class_period %>">
|
|
|
|
|
<span class="c_red" id="course_class_period_notice" style="display: none;"></span>
|
|
|
|
|
</li>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<li class="ml45 mb10">
|
|
|
|
|
<label><span class="c_red">*</span> <%= l(:label_course_term)%> :</label>
|
|
|
|
|
<%= select_tag :time,options_for_select(course_time_option(@new_course.time),@new_course.time), {} %>
|
|
|
|
|
<%= select_tag :term,options_for_select(course_term_option,@new_course.term || cur_course_term),{} %>
|
|
|
|
|
<span class="c_red" id="course_time_term_notice"></span>
|
|
|
|
|
</li>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<li class="ml45 mb10">
|
|
|
|
|
<label><span class="c_red">*</span> 结束学期 :</label>
|
|
|
|
|
<%= select_tag :end_time,options_for_select(course_time_option(@new_course.end_time),@new_course.end_time), {} %>
|
|
|
|
|
<%= select_tag :end_term,options_for_select(course_term_option,@new_course.end_term || cur_course_term),{} %>
|
|
|
|
|
<span class="mr15 c_red">仅针对跨越多个学期的班级,否则不用修改。</span>
|
|
|
|
|
</li>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<li class="ml45 mb10">
|
|
|
|
|
<label><span class="c_red">*</span> <%= l(:label_new_course_password)%> :</label>
|
|
|
|
|
<input type="text" style="display: none;">
|
|
|
|
|
<input type="text" name="course[password]" id="course_course_password" class="hwork_input02 grey_border" onkeyup="regex_course_password();" value="<%=@course.password %>">
|
|
|
|
|
<!--<a id="psw_btn" href="javascript:void(0)">显示明码</a>-->
|
|
|
|
|
<span class="c_red" id="course_course_password_notice"></span>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<span class="ml95 c_red">学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。</span>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="ml50">
|
|
|
|
|
<label class="fl" > <%= l(:label_new_course_description)%> :</label>
|
|
|
|
|
<textarea name="course[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="courses_text fl grey_border" ><%= @course.description.nil? ? "" : @course.description %></textarea>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</li>
|
|
|
|
|
<li class=" mb5 ml85">
|
|
|
|
|
<label >公开 :</label>
|
|
|
|
|
<input <%= @course.is_public == 1 ? 'checked' : ''%> id="course_is_public" name="course[is_public]" type="checkbox" value="<%=@course.is_public.to_i %>">
|
|
|
|
|
<span class="c_grey">(选中后课外用户可见该课程,否则仅对课内成员可见)</span>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</li>
|
2016-02-26 11:16:12 +08:00
|
|
|
|
<li class="ml85">
|
2016-02-26 10:41:14 +08:00
|
|
|
|
<label class="fl">复制 :</label>
|
2016-02-26 11:16:12 +08:00
|
|
|
|
<ul class="fl" id="copyResource" style="width:544px;">
|
|
|
|
|
<li class="sendCourseName fl ml5">
|
|
|
|
|
<label class="fl">
|
2016-02-26 10:41:14 +08:00
|
|
|
|
<input name="course_content_type[]" type="checkbox" value="0" class="resourceCopy"/>
|
|
|
|
|
作业</label>
|
2016-02-26 11:16:12 +08:00
|
|
|
|
<span class="c_red ml5 fl mb10 w490">复制到新课中的作业将在1个月后发布、2个月后提交截止,请您调整作业的发布时间、截止时间等时间节点。</span>
|
2016-01-08 10:49:02 +08:00
|
|
|
|
</li>
|
2016-02-26 11:16:12 +08:00
|
|
|
|
<li class="sendCourseName fl ml5">
|
|
|
|
|
<label class="fl">
|
2016-02-26 10:41:14 +08:00
|
|
|
|
<input name="course_content_type[]" type="checkbox" value="1" class="resourceCopy"/>
|
|
|
|
|
资源</label>
|
2016-02-26 11:16:12 +08:00
|
|
|
|
<span class="c_red ml5 fl mb10">复制到新课的资源将在1个月后发布,请您调整资源的发布时间,否则学生可能看不到资源。</span>
|
2016-02-26 10:41:14 +08:00
|
|
|
|
</li>
|
2016-01-08 10:49:02 +08:00
|
|
|
|
</ul>
|
2016-02-26 10:41:14 +08:00
|
|
|
|
<!--<ul class="fl" id="copyResource2">
|
2016-01-08 10:49:02 +08:00
|
|
|
|
<li class="sendCourseName fl mr15">
|
|
|
|
|
<label>
|
|
|
|
|
<input name="course_attachment_type[]" type="checkbox" value="1" class="resourceCopy"/>
|
|
|
|
|
课件</label>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="sendCourseName fl mr15">
|
|
|
|
|
<label>
|
|
|
|
|
<input name="course_attachment_type[]" type="checkbox" value="2" class="resourceCopy"/>
|
|
|
|
|
软件</label>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="sendCourseName fl mr15">
|
|
|
|
|
<label>
|
|
|
|
|
<input name="course_attachment_type[]" type="checkbox" value="3" class="resourceCopy"/>
|
|
|
|
|
媒体</label>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="sendCourseName fl mr15">
|
|
|
|
|
<label>
|
|
|
|
|
<input name="course_attachment_type[]" type="checkbox" value="4" class="resourceCopy"/>
|
|
|
|
|
代码</label>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="sendCourseName fl mr15">
|
|
|
|
|
<label>
|
|
|
|
|
<input name="course_attachment_type[]" type="checkbox" value="6" class="resourceCopy"/>
|
|
|
|
|
论文</label>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="sendCourseName fl mr15">
|
|
|
|
|
<label>
|
|
|
|
|
<input name="course_attachment_type[]" type="checkbox" value="5" class="resourceCopy"/>
|
|
|
|
|
其它</label>
|
|
|
|
|
</li>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</ul>
|
2016-02-26 10:41:14 +08:00
|
|
|
|
<span class="c_red ml5 fl mb10">您可以通过选择类型,将对应类型复制到新课程中。</span>-->
|
2016-01-08 10:49:02 +08:00
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</li>
|
|
|
|
|
<% end %>
|
|
|
|
|
</ul>
|
|
|
|
|
<div>
|
2016-02-26 17:44:46 +08:00
|
|
|
|
<a href="javascript:void(0);" class="greyBtn fr mr40 f12" id="submit_copy_course" onclick="submit_copy_course();">完成</a>
|
2016-01-08 10:49:02 +08:00
|
|
|
|
<a href="javascript:void(0);" class="greyBtn fr mr10 f12" onclick="hideResource();">取消</a>
|
|
|
|
|
</div>
|
2016-02-26 17:44:46 +08:00
|
|
|
|
<div class="cl"></div>
|