socialforge/app/views/courses/_copy_course.html.erb

146 lines
7.3 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<script type="text/javascript">
$(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"/>
<li class="ml45 mb10">
<a href="javascript:void(0)" class="upimg fl">
<%= image_tag(url_to_avatar(@new_course), id: "avatar_image", :width =>"60", :height =>"60",:alt=>"上传图片")%>
</a> <!--<a href="javascript:void(0)" class="upbtn fl ml30" onclick="$('#upload_course_logo').click();">上传图片</a>-->
<!--</span>-->
<div class="cl"></div>
</li>
<li class="ml45">
<input type="text" style="display: none"/> <!--阻止表单自动填充 -->
<input type="password" style="display: none"/> <!--阻止表单自动填充 -->
<label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_course_name)%>&nbsp;&nbsp;</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>&nbsp;<%= l(:label_class_period)%>&nbsp;&nbsp;</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>&nbsp;<%= l(:label_course_term)%>&nbsp;&nbsp;</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>&nbsp;结束学期&nbsp;&nbsp;</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>&nbsp;<%= l(:label_new_course_password)%>&nbsp;&nbsp;</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" >&nbsp;&nbsp;<%= l(:label_new_course_description)%>&nbsp;&nbsp;</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 >公开&nbsp;&nbsp;</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>
<li class="ml58">
<label class="fl">复制资源&nbsp;&nbsp;</label>
<ul class="fl" id="copyResource">
<li class="sendCourseName fl mr15 ml5">
<label>
<input name="checkAll" type="checkbox" id="allResource" value="0" class="resourceCopy"/>
全部</label>
</li>
</ul>
<ul class="fl" id="copyResource2">
<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>
<span class="c_red ml5 fl mb10">您可以通过选择资源类型,将对应资源复制到新课程中。</span>
<div class="cl"></div>
</li>
<% end %>
</ul>
<div>
<a href="javascript:void(0);" class="greyBtn fr mr40 f12" onclick="submit_new_course();">完成</a>
<a href="javascript:void(0);" class="greyBtn fr mr10 f12" onclick="hideResource();">取消</a>
</div>
<div class="cl"></div>