新建班级、新建课程的提示
This commit is contained in:
parent
9f702bae1e
commit
557f5d4e26
|
@ -12,12 +12,15 @@
|
||||||
<span><%=@syllabus.title %></span>
|
<span><%=@syllabus.title %></span>
|
||||||
<input style="display: none;" name="syllabus_id" value="<%=@syllabus.id %>" />
|
<input style="display: none;" name="syllabus_id" value="<%=@syllabus.id %>" />
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<span class="c_red ml80" id="new_course_syllabus_notice" style="display: none;">请先选择课程</span>
|
||||||
</li>
|
</li>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<li class="mt10 ml45">
|
<li class="mt10 ml45">
|
||||||
<label><span class="c_red">*</span> <%= l(:label_tags_course_name)%> :</label>
|
<label><span class="c_red">*</span> <%= l(:label_tags_course_name)%> :</label>
|
||||||
<input type="text" name="course[name]" id="new_course_name" class="courses_input w289" maxlength="100" placeholder="例如:计算机系2016秋季A班" onkeyup="regex_course_name('new');">
|
<input type="text" name="course[name]" id="new_course_name" class="courses_input w289" maxlength="100" placeholder="例如:计算机系2016秋季A班" onkeyup="regex_course_name('new');">
|
||||||
<span class="c_red" id="new_course_name_notice" style="display: none;">班级名称不能为空且至少有两个字符</span>
|
<div class="cl"></div>
|
||||||
|
<span class="c_red ml80" id="new_course_name_notice" style="display: none;">班级名称不能为空且至少有两个字符</span>
|
||||||
</li>
|
</li>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<li class="ml125 mb5 fontGrey3"><span class="success-icon mr25">正确示例:计算机系2016秋季A班</span></li>
|
<li class="ml125 mb5 fontGrey3"><span class="success-icon mr25">正确示例:计算机系2016秋季A班</span></li>
|
||||||
|
|
|
@ -6,8 +6,9 @@
|
||||||
<%= labelled_form_for @syllabus do |f| %>
|
<%= labelled_form_for @syllabus do |f| %>
|
||||||
<li class="ml45">
|
<li class="ml45">
|
||||||
<label><span class="c_red">*</span> 课程名称 :</label>
|
<label><span class="c_red">*</span> 课程名称 :</label>
|
||||||
<input type="text" name="title" id="new_syllabus_name" class="name_input" placeholder="例如:软件工程" maxlength="100" onkeyup="regex_syllabus_name();">
|
<input type="text" name="title" id="new_syllabus_name" class="name_input" placeholder="例如:软件工程" maxlength="100" onkeyup="regex_syllabus_name();">
|
||||||
<span class="c_red" id="new_syllabus_name_notice" style="display: none;">课程名称不能为空且至少有两个字符</span>
|
<div class="cl"></div>
|
||||||
|
<span class="c_red ml80" id="new_syllabus_name_notice" style="display: none;">课程名称不能为空且至少有两个字符</span>
|
||||||
</li>
|
</li>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<li class="ml125 fontGrey3"><span class="success-icon mr25">正确示例:软件工程</span><span class="error-icon">错误示例:2016软件工程</span></li>
|
<li class="ml125 fontGrey3"><span class="success-icon mr25">正确示例:软件工程</span><span class="error-icon">错误示例:2016软件工程</span></li>
|
||||||
|
|
|
@ -189,11 +189,14 @@ function regex_syllabus_option(str) {
|
||||||
var obj = document.getElementById(str + "_syllabus_id");
|
var obj = document.getElementById(str + "_syllabus_id");
|
||||||
var syllabus = obj.options[obj.selectedIndex];
|
var syllabus = obj.options[obj.selectedIndex];
|
||||||
if(parseInt(syllabus.value) == 0) {
|
if(parseInt(syllabus.value) == 0) {
|
||||||
|
$("#"+str+"_course_syllabus_notice").show();
|
||||||
return false;
|
return false;
|
||||||
} else{
|
} else{
|
||||||
|
$("#"+str+"_course_syllabus_notice").hide();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
$("#"+str+"_course_syllabus_notice").hide();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue