新建作业初始显示调整
This commit is contained in:
parent
20465ef281
commit
003c6a7551
|
@ -3728,7 +3728,7 @@ end
|
|||
def homework_type_option
|
||||
type = []
|
||||
option0 = []
|
||||
option0 << "请选择"
|
||||
option0 << "请选择作业类型"
|
||||
option0 << 0
|
||||
option1 = []
|
||||
option1 << "普通作业"
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
$("#homework_end_time_span").text("");
|
||||
$("#homework_course_id_span").text("");
|
||||
$("#homework_editor").toggle();
|
||||
$("#select_type_nitice").show();
|
||||
//$("#select_type_nitice").show();
|
||||
document.getElementById("homework_type_option").options[0].selected = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,10 +4,17 @@
|
|||
|
||||
<%= javascript_include_tag 'homework','baiduTemplate' %>
|
||||
<script type="text/javascript">
|
||||
function homework_name_focus(){
|
||||
$('#homework_editor').show();
|
||||
var type = $("#homework_type_option").children('option:selected').val();
|
||||
if(type == "0"){
|
||||
$('#select_type_nitice').show();
|
||||
}
|
||||
}
|
||||
var first_click = true;
|
||||
$(function(){
|
||||
$("#homework_type_option").on("change",function(){
|
||||
$('#homework_editor').show();
|
||||
//$('#homework_editor').show();
|
||||
var type = $(this).children('option:selected').val();
|
||||
if(type == "0"){
|
||||
$('#select_type_nitice').show();
|
||||
|
@ -192,14 +199,12 @@
|
|||
<% if not_allow_select || group_pro %>
|
||||
<input type="text" style="display: none" name="homework_type" value="<%=homework.homework_type %>"/>
|
||||
<% end %>
|
||||
<span class="c_red fl ml10 mt5 <%= edit_mode ? 'none' : '' %>" id="select_type_nitice">发布作业,请先选择作业类型</span>
|
||||
<%= link_to("从题库选用", user_import_homeworks_user_path(User.current.id,:select_course => defined?(select_course)),:class => "BlueCirBtn fr",:remote => true,:title=>"导入自己发布过的作业,或者共享题库中的作业") unless edit_mode%>
|
||||
<span class="c_red fl ml10 mt5 none" id="select_type_nitice">发布作业,请先选择作业类型</span>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div id="homework_editor" class="mt10" style="display: <%= edit_mode ? 'block':'none'%>">
|
||||
<div>
|
||||
<input type="text" name="homework_common[name]" id="homework_name" class="InputBox fl w701" maxlength="255" onkeyup="regex_homework_name();" placeholder="发布作业,请先输入作业标题" value="<%= homework.name%>" >
|
||||
<div class="mt10">
|
||||
<input type="text" name="homework_common[name]" id="homework_name" class="InputBox fl w701 <%= edit_mode ? 'w701' : 'w603' %>" maxlength="255" onfocus="homework_name_focus();" onkeyup="regex_homework_name();" placeholder="发布作业,请先输入作业标题" value="<%= homework.name%>" >
|
||||
<%= link_to("从题库选用", user_import_homeworks_user_path(User.current.id,:select_course => defined?(select_course)),:class => "BlueCirBtn fr",:remote => true,:title=>"导入自己发布过的作业,或者共享题库中的作业") unless edit_mode%>
|
||||
<% unless edit_mode %>
|
||||
<input type="hidden" name="quotes" id="ref_homework_id" value=""/>
|
||||
<% end %>
|
||||
|
@ -208,6 +213,7 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div id="homework_editor" style="display: <%= edit_mode ? 'block':'none'%>">
|
||||
<div class="mt10">
|
||||
<label class="fl c_grey f14 mt5">截止日期:</label>
|
||||
<div class="calendar_div fl mr70">
|
||||
|
|
|
@ -766,6 +766,12 @@ function submit_homework(id){
|
|||
//验证新建作业的名字
|
||||
function regex_homework_name()
|
||||
{
|
||||
var type = $("#homework_type_option").children('option:selected').val();
|
||||
if(type == "0"){
|
||||
$('#select_type_nitice').show();
|
||||
return false;
|
||||
}
|
||||
|
||||
var name = $.trim($("#homework_name").val());
|
||||
|
||||
if(name=="")
|
||||
|
|
|
@ -548,7 +548,7 @@ a:hover.blueCir{ background:#3598db; color:#fff;}
|
|||
#worksDescription p {word-wrap:break-word;}
|
||||
|
||||
/*20160907作业详情更改*/
|
||||
.homework-type-option {border:1px solid #d9d9d9; width:98px; height:28px; color:#888; font-size:14px;}
|
||||
.homework-type-option {border:1px solid #d9d9d9; width:128px; height:28px; color:#888; font-size:14px;}
|
||||
.homework-detail-tab {font-size:14px; color:#484848; overflow:hidden;}
|
||||
.homework-detail-tab li {float:left; width:100px; text-align:center; padding:3px 0; border-bottom:2px solid #ddd;}
|
||||
.homework-detail-tab li.selected {border-bottom:2px solid #f00;}
|
||||
|
|
Loading…
Reference in New Issue