From baa512e4d73244d81a50c8dfbd0396d05adf3eaa Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 28 Aug 2017 15:02:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E8=AE=BE=E7=BD=AE=E7=9A=84?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 4 +-- app/views/homework_common/setting.html.erb | 2 +- public/javascripts/edu/base_edu.js | 28 +++++++++---------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 70aec8ffc..315a69d9d 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -190,7 +190,7 @@ class HomeworkCommonController < ApplicationController # homework_bank.save # homework.update_attributes(:homework_bank_id => homework_bank.id) # end - redirect_to student_work_index_path(:homework => homework.id, :host=> Setting.host_course) + redirect_to setting_homework_common_path(homework, :is_new => 1) end end end @@ -340,7 +340,7 @@ class HomeworkCommonController < ApplicationController end @homework.save @homework_detail_manual.save - redirect_to setting_homework_common_path(@homework) + redirect_to student_work_index_path(:homework => @homework.id, :host=> Setting.host_course) end def edit diff --git a/app/views/homework_common/setting.html.erb b/app/views/homework_common/setting.html.erb index 72eba3370..f3cd6f89e 100644 --- a/app/views/homework_common/setting.html.erb +++ b/app/views/homework_common/setting.html.erb @@ -94,7 +94,7 @@
- 提交 + 确定 取消
<% end %> diff --git a/public/javascripts/edu/base_edu.js b/public/javascripts/edu/base_edu.js index ebb65a064..266da3302 100644 --- a/public/javascripts/edu/base_edu.js +++ b/public/javascripts/edu/base_edu.js @@ -180,26 +180,26 @@ $(function(){ allowBlank:true, lang:'ch', format:'Y-m-d H:i', - validateOnBlur:false, - onSelectDate:function() { - if($.trim($("input[name='homework_archive_time']").val()) == ""){ - var date = new Date(Date.parse($("input[name='homework_publish_time']").val().replace(/-/g, "/"))); - $("input[name='homework_archive_time']").val(formate_time(new Date(date.setMonth(date.getMonth()+1)))); - } - }, - onSelectTime:function() { - if($.trim($("input[name='homework_archive_time']").val()) == ""){ - var date = new Date(Date.parse($("input[name='homework_publish_time']").val().replace(/-/g, "/"))); - $("input[name='homework_archive_time']").val(formate_time(new Date(date.setMonth(date.getMonth()+1)))); - } - } + validateOnBlur:false }); $("input[name='homework_end_time']").datetimepicker({ allowBlank:true, lang:'ch', format:'Y-m-d H:i', - validateOnBlur:false + validateOnBlur:false, + onSelectDate:function() { + if($.trim($("input[name='homework_archive_time']").val()) == ""){ + var date = new Date(Date.parse($("input[name='homework_end_time']").val().replace(/-/g, "/"))); + $("input[name='homework_archive_time']").val(formate_time(new Date(date.setMonth(date.getMonth()+1)))); + } + }, + onSelectTime:function() { + if($.trim($("input[name='homework_archive_time']").val()) == ""){ + var date = new Date(Date.parse($("input[name='homework_end_time']").val().replace(/-/g, "/"))); + $("input[name='homework_archive_time']").val(formate_time(new Date(date.setMonth(date.getMonth()+1)))); + } + } }); $("input[name='homework_archive_time']").datetimepicker({