educoder/app/views/courses/new.html.erb

111 lines
6.7 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.

<div class="stud-class-container">
<p style="line-height: 2.0;">
<i class="fa fa-map-marker mr5 color-grey"></i>
<%= link_to User.current.show_real_name, user_path(User.current) %> > <%= link_to '在线课堂', courses_path %>
</p>
<div class="user_bg_shadow bor-grey-e">
<div class="edu-con-top ">
<span class="ml15 color-grey font-16">新建课堂</span>
</div>
<div class="con-content">
<%= labelled_form_for @course do |f| %>
<ul>
<li class="clearfix pt20">
<label class="panel-form-label label fl color-dark-grey"><span class="color-orange mr5">*</span>课程名字&nbsp;&nbsp;&nbsp;&nbsp;</label>
<% if @syllabus.nil? %>
<%= select_tag :syllabus_id,options_for_select(course_syllabus_option,@course.syllabus_id), {:id=>"new_syllabus_id", :class=>"task task-height-40 panel-box-sizing fl color-grey", :onchange => "change_course_name();"} %>
<!--<div class="with75 fl pr" select-for="">-->
<!--<input type="hidden" name="major_level" id="major_level" value="2">-->
<!--<input class="task-height-40 task-form-100 panel-box-sizing pr20 color-grey3" readonly="" placeholder="选择课程所属专业层级">-->
<!--<div class="down-select bor-grey-e user_bg_shadow" id="major_level_option" style="display: none;">-->
<!--<p data-major="3">专科</p>-->
<!--<p data-major="2">本科</p>-->
<!--<p data-major="1">研究生</p>-->
<!--</div>-->
<!--<i class="fa fa-sort-desc lesson_img"></i>-->
<!--</div>-->
<% else %>
<span id="course_syllabus_title" class="task task-height-40 panel-box-sizing fl color-grey"><%=@syllabus.title %></span>
<input style="display: none;" name="syllabus_id" value="<%=@syllabus.id %>" />
<% end %>
<div class="tusi">
<div class="entry">
<em></em>
<span class="after"></span>
<p class="color-grey">课程列表中没有?<%= link_to '创建课程', new_syllabus_path(),:target => '_blank', :class => 'color-orange05' %></p>
</div>
</div>
<div class="cl"></div>
<span class="color-orange fl none" id="new_course_syllabus_notice" style="margin-left:25%;"><i class="fa fa-exclamation-circle mr5" ></i>请先选择课程</span>
</li>
<li class="pt20 clearfix">
<label class="panel-form-label label fl color-dark-grey"><span class="color-orange mr5">*</span>课堂名称&nbsp;&nbsp;&nbsp;&nbsp;</label>
<input type="text" name="course[name]" id="new_course_name" class="task task-height-40 panel-box-sizing fl color-grey" maxlength="100" placeholder="例如软件工程计算机系2016秋季A班" onkeyup="regex_course_name('new');">
<div class="cl"></div>
<span class="color-orange fl none" id="new_course_name_notice" style="margin-left:25%;"><i class="fa fa-exclamation-circle mr5" ></i>课堂名称不能为空且至少有两个字符</span>
<div class="cl"></div>
<li class="ml125 mb5 fontGrey3" style="margin-left:25%;"><i class="fa fa-check-circle color-light-green mr5"></i>正确示例软件工程计算机系2016秋季A班</li>
<li class="ml125 fontGrey3" style="margin-left:25%;"><i class="fa fa-times-circle color-orange mr5"></i>错误示例计算机系2016秋季A班</li>
</li>
<li class="pt20 clearfix">
<label class="panel-form-label label fl color-dark-grey">总学时&nbsp;&nbsp;&nbsp;&nbsp;</label>
<input type="text" name="period" id="new_class_period" class="task task-height-40 panel-box-sizing fl cut color-grey" onkeyup="regex_course_class_period('new');" placeholder="例如&nbsp;&nbsp;30" maxlength="6">
<div class="cl"></div>
<span class="color-orange fl none" id="new_course_class_period_notice" style="margin-left:25%;"><i class="fa fa-exclamation-circle mr5" ></i>请输入正整数</span>
</li>
<li class="pt20 clearfix">
<label class="panel-form-label label fl color-dark-grey">学分&nbsp;&nbsp;&nbsp;&nbsp;</label>
<input type="text" id="new_course_credit" name="credit" maxlength="4" onkeyup="regex_course_credit('new');" class="task task-height-40 panel-box-sizing fl cut color-grey" onkeyup="regex_course_credit('new');" placeholder="例如&nbsp;&nbsp;4">
<div class="cl"></div>
<span class="color-orange fl none" id="new_course_credit_notice" style="margin-left:25%;"><i class="fa fa-exclamation-circle mr5" ></i>请输入正整数或保留一位小数的浮点数</span>
</li>
<li class="pt20 clearfix">
<label class="panel-form-label label fl color-dark-grey">结束时间&nbsp;&nbsp;&nbsp;&nbsp;</label>
<input type="text" id="new_course_end_date" class="task task-height-40 panel-box-sizing fl cut color-grey" name="end_date" placeholder="请选择结束日期">
<div class="cl"></div>
<div class="tusi">
<div class="entry">
<em></em>
<span class="after"></span>
<p class="color-grey">结束日期过后,课堂进入<%= link_to '归档状态', new_syllabus_path(),:target => '_blank', :class => 'color-orange05' %>,只能在历史课堂中查看</p>
</div>
</div>
<div class="cl"></div>
<span class="color-orange fl none" id="new_course_end_date_notice" style="margin-left:25%;"><i class="fa fa-exclamation-circle mr5" ></i>结束日期必须晚于当前日期</span>
</li>
<li class="pt20 clearfix">
<label class="panel-form-label label fl">&nbsp;&nbsp;&nbsp;&nbsp;</label>
<input id="course_is_public" name="course[is_public]" class="magic-checkbox fl mt8 mr5" type="checkbox" value="1">
<label for="course_is_public" class="color-grey fl">公开(选中后所有用户可见,否则仅课堂成员可见)</label>
</li>
<li class=" clearfix pb20">
<label class="panel-form-label label fl">&nbsp;&nbsp;&nbsp;&nbsp;</label>
<a href="javascript:void(0);" class="task-btn task-btn-blue fl mr10" onclick="submit_new_course();">保存</a>
<%= link_to '取消', courses_path, :class => 'task-btn fl' %>
</li>
</ul>
<% end %>
</div>
</div>
</div>
<script>
$(function(){
<% unless @syllabus.nil? %>
$("#new_course_name").val('<%= @syllabus.title %>');
$("#new_course_name").focus();
<% end %>
//var date = new Date();//获取当前时间
//var nextDate = new Date(date.getTime() + 24*60*60*1000);//设置天数 +1 天
$('#new_course_end_date').datetimepicker({
allowBlank:true,
lang:'ch',
format:'Y-m-d',
formatDate:'Y-m-d',
timepicker:false,
validateOnBlur:false
});
});
</script>