Merge branch 'cxt_course' of https://git.trustie.net/jacknudt/trustieforge into cxt_course

This commit is contained in:
cxt 2016-01-08 14:53:20 +08:00
commit c5a10c504e
3 changed files with 1148 additions and 1139 deletions

View File

@ -1,142 +1,142 @@
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function(){ $(document).ready(function(){
$("#time").change(function(){ $("#time").change(function(){
document.getElementById("end_time").options[document.getElementById("time").selectedIndex].selected = true; document.getElementById("end_time").options[document.getElementById("time").selectedIndex].selected = true;
}); });
$("#term").change(function(){ $("#term").change(function(){
document.getElementById("end_term").options[document.getElementById("term").selectedIndex].selected = true; document.getElementById("end_term").options[document.getElementById("term").selectedIndex].selected = true;
}); });
var popupHeight = $(".referenceResourcesPopup").outerHeight(true); var popupHeight = $(".referenceResourcesPopup").outerHeight(true);
$(".referenceResourcesPopup").css("marginTop",-popupHeight/2); $(".referenceResourcesPopup").css("marginTop",-popupHeight/2);
$(".resourcePopupClose").click(function(){ $(".resourcePopupClose").click(function(){
hideModal(); hideModal();
}); });
$("#copyResource").click(function(){ $("#copyResource").click(function(){
if ($("#allResource").is(":checked")){ if ($("#allResource").is(":checked")){
$("input[name='course_attachment_type[]']").attr("checked",true); $("input[name='course_attachment_type[]']").attr("checked",true);
} }
else{ else{
$("input[name='course_attachment_type[]']").attr("checked",false); $("input[name='course_attachment_type[]']").attr("checked",false);
} }
}); });
$("#copyResource2").click(function(){ $("#copyResource2").click(function(){
if ($("input[name='course_attachment_type[]']:checked").length == 6){ if ($("input[name='course_attachment_type[]']:checked").length == 6){
$("#allResource").attr("checked",true); $("#allResource").attr("checked",true);
} }
else{ else{
$("#allResource").attr("checked",false); $("#allResource").attr("checked",false);
} }
}); });
}); });
</script> </script>
<div> <div>
<div class="referenceText">信息配置</div> <div class="referenceText">信息配置</div>
</div> </div>
<ul class="mt10"> <ul class="mt10">
<%=labelled_form_for @new_course do |f| %> <%=labelled_form_for @new_course do |f| %>
<input name="copy_course" value="<%=@course.id %>" style="display: none"/> <input name="copy_course" value="<%=@course.id %>" style="display: none"/>
<li class="ml45 mb10"> <a href="javascript:void(0)" class="upimg fl"> <img alt="上传图片" id="avatar_image" src="images/courses/pic_courses.jpg" height="60" width="60"> </a> <a href="javascript:void(0)" class="upbtn fl" onclick="$('#upload_course_logo').click();">上传图片</a> <li class="ml45 mb10"> <a href="javascript:void(0)" class="upimg fl"> <img alt="上传图片" id="avatar_image" src="images/courses/pic_courses.jpg" height="60" width="60"> </a> <a href="javascript:void(0)" class="upbtn fl ml30" onclick="$('#upload_course_logo').click();">上传图片</a>
<!--</span>--> <!--</span>-->
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<li class="ml45"> <li class="ml45">
<input type="text" style="display: none"/> <!--阻止表单自动填充 --> <input type="text" style="display: none"/> <!--阻止表单自动填充 -->
<input type="password" style="display: none"/> <!--阻止表单自动填充 --> <input type="password" style="display: none"/> <!--阻止表单自动填充 -->
<label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_course_name)%>&nbsp;&nbsp;</label> <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" maxlength="100" onkeyup="regex_course_name();" value="<%=@course.name %>"> <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> <span class="c_red" id="course_name_notice" style="display: none;">课程名称不能为空</span>
<div class="cl"></div> <div class="cl"></div>
<li class="ml45"> <li class="ml45">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_class_period)%>&nbsp;&nbsp;</label> <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" onkeyup="regex_course_class_period();" maxlength="6" value="<%=@course.class_period %>"> <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> <span class="c_red" id="course_class_period_notice" style="display: none;"></span>
</li> </li>
<div class="cl"></div> <div class="cl"></div>
<li class="ml45 mb10"> <li class="ml45 mb10">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_course_term)%>&nbsp;&nbsp;</label> <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 :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),{} %> <%= 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> <span class="c_red" id="course_time_term_notice"></span>
</li> </li>
<div class="cl"></div> <div class="cl"></div>
<li class="ml45 mb10"> <li class="ml45 mb10">
<label><span class="c_red">*</span>&nbsp;结束学期&nbsp;&nbsp;</label> <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_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),{} %> <%= select_tag :end_term,options_for_select(course_term_option,@new_course.end_term || cur_course_term),{} %>
<span class="mr15 c_red">仅针对跨越多个学期的班级,否则不用修改。</span> <span class="mr15 c_red">仅针对跨越多个学期的班级,否则不用修改。</span>
</li> </li>
<div class="cl"></div> <div class="cl"></div>
<li class="ml45 mb10"> <li class="ml45 mb10">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_new_course_password)%>&nbsp;&nbsp;</label> <label><span class="c_red">*</span>&nbsp;<%= l(:label_new_course_password)%>&nbsp;&nbsp;</label>
<input type="text" style="display: none;"> <input type="text" style="display: none;">
<input type="text" name="course[password]" id="course_course_password" class="hwork_input02" onkeyup="regex_course_password();" value="<%=@course.password %>"> <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>--> <!--<a id="psw_btn" href="javascript:void(0)">显示明码</a>-->
<span class="c_red" id="course_course_password_notice"></span> <span class="c_red" id="course_course_password_notice"></span>
<div class="cl"></div> <div class="cl"></div>
<span class="ml80 c_red">学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。</span> <span class="ml95 c_red">学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。</span>
</li> </li>
<li class="ml45"> <li class="ml50">
<label class="fl" >&nbsp;&nbsp;<%= l(:label_new_course_description)%>&nbsp;&nbsp;</label> <label class="fl" >&nbsp;&nbsp;<%= l(:label_new_course_description)%>&nbsp;&nbsp;</label>
<textarea name="course[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="courses_text fl" ><%= @course.description.nil? ? "" : @course.description %></textarea> <textarea name="course[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="courses_text fl grey_border" ><%= @course.description.nil? ? "" : @course.description %></textarea>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<li class=" mb5 ml80"> <li class=" mb5 ml85">
<label >公开&nbsp;&nbsp;</label> <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 %>"> <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> <span class="c_grey">(选中后课外用户可见该课程,否则仅对课内成员可见)</span>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<li class="ml48"> <li class="ml58">
<label class="fl">&nbsp;&nbsp;复制资源&nbsp;&nbsp;</label> <label class="fl">复制资源&nbsp;&nbsp;</label>
<ul class="mb10 fl" id="copyResource"> <ul class="fl" id="copyResource">
<li class="sendCourseName fl mr15 ml5"> <li class="sendCourseName fl mr15 ml5">
<label> <label>
<input name="checkAll" type="checkbox" id="allResource" value="0" class="resourceCopy"/> <input name="checkAll" type="checkbox" id="allResource" value="0" class="resourceCopy"/>
全部</label> 全部</label>
</li> </li>
</ul> </ul>
<ul class="mb10 fl" id="copyResource2"> <ul class="fl" id="copyResource2">
<li class="sendCourseName fl mr15"> <li class="sendCourseName fl mr15">
<label> <label>
<input name="course_attachment_type[]" type="checkbox" value="1" class="resourceCopy"/> <input name="course_attachment_type[]" type="checkbox" value="1" class="resourceCopy"/>
课件</label> 课件</label>
</li> </li>
<li class="sendCourseName fl mr15"> <li class="sendCourseName fl mr15">
<label> <label>
<input name="course_attachment_type[]" type="checkbox" value="2" class="resourceCopy"/> <input name="course_attachment_type[]" type="checkbox" value="2" class="resourceCopy"/>
软件</label> 软件</label>
</li> </li>
<li class="sendCourseName fl mr15"> <li class="sendCourseName fl mr15">
<label> <label>
<input name="course_attachment_type[]" type="checkbox" value="3" class="resourceCopy"/> <input name="course_attachment_type[]" type="checkbox" value="3" class="resourceCopy"/>
媒体</label> 媒体</label>
</li> </li>
<li class="sendCourseName fl mr15"> <li class="sendCourseName fl mr15">
<label> <label>
<input name="course_attachment_type[]" type="checkbox" value="4" class="resourceCopy"/> <input name="course_attachment_type[]" type="checkbox" value="4" class="resourceCopy"/>
代码</label> 代码</label>
</li> </li>
<li class="sendCourseName fl mr15"> <li class="sendCourseName fl mr15">
<label> <label>
<input name="course_attachment_type[]" type="checkbox" value="6" class="resourceCopy"/> <input name="course_attachment_type[]" type="checkbox" value="6" class="resourceCopy"/>
论文</label> 论文</label>
</li> </li>
<li class="sendCourseName fl mr15"> <li class="sendCourseName fl mr15">
<label> <label>
<input name="course_attachment_type[]" type="checkbox" value="5" class="resourceCopy"/> <input name="course_attachment_type[]" type="checkbox" value="5" class="resourceCopy"/>
其它</label> 其它</label>
</li> </li>
<div class="cl"></div> <div class="cl"></div>
<span class="c_red ml5 fl">您可以通过选择资源类型,将对应资源复制到新课程中。</span> </ul>
</ul> <span class="c_red ml5 fl mb10">您可以通过选择资源类型,将对应资源复制到新课程中。</span>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<% end %> <% end %>
</ul> </ul>
<div> <div>
<a href="javascript:void(0);" class="greyBtn fr mr40" onclick="submit_new_course();">完成</a> <a href="javascript:void(0);" class="greyBtn fr mr40 f12" onclick="submit_new_course();">完成</a>
<a href="javascript:void(0);" class="greyBtn fr mr10" onclick="hideResource();">取消</a> <a href="javascript:void(0);" class="greyBtn fr mr10 f12" onclick="hideResource();">取消</a>
</div> </div>
<div class="cl"></div> <div class="cl"></div>

View File

@ -1,10 +1,10 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'copy_course') %>'); $('#ajax-modal').html('<%= escape_javascript(render :partial => 'copy_course') %>');
showModal('ajax-modal', '730px'); showModal('ajax-modal', '730px');
$('#ajax-modal').css('height','530px').css('width','730px'); $('#ajax-modal').css('height','530px').css('width','730px');
$('#ajax-modal').siblings().remove(); $('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<div class='resourcePopupClose mt5 mr-5'>" + $('#ajax-modal').before("<div class='resourcePopupClose mt5 mr-5'>" +
"<a href='javascript:void(0)' class='resourceClose' onclick='hideResource();'></a></div>"); "<a href='javascript:void(0)' class='resourceClose' onclick='hideResource();'></a></div>");
$('#ajax-modal').parent().css("top","30%").css("left","").css("position","fixed"); $('#ajax-modal').parent().css("top","30%").css("left","").css("position","fixed");
$('#ajax-modal').parent().addClass("popbox").addClass("referenceResourcesPopup"); $('#ajax-modal').parent().addClass("popbox").addClass("copyCoursePopup");

File diff suppressed because it is too large Load Diff