修改重启课程
This commit is contained in:
parent
6a9037dde5
commit
529cf4f4f8
|
@ -318,6 +318,21 @@ class CoursesController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def restartcourse
|
||||
day = Time.parse("3000-01-01")
|
||||
|
||||
@course_prefs.endup_time = day
|
||||
@save_flag = @course_prefs.save
|
||||
|
||||
respond_to do |format|
|
||||
format.js {
|
||||
render action:'finishcourse'
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
private
|
||||
|
||||
def allow_join
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<% if @save_flag %>
|
||||
<% if Rails.env.development? %>
|
||||
console.debug('课程修改成功:结束时间改为<%=Course.find_by_extra(@project.extra).try(:endup_time)%>');
|
||||
console.debug('课程修改成功:结束时间改为<%=Course.find_by_extra(@course.extra).try(:endup_time)%>');
|
||||
<% end %>
|
||||
$('#finish_course_<%=@course.id%>').replaceWith("<%= j(render partial: 'courses/set_course_time', :locals => {:course => @course} )%>")
|
||||
<% else %>
|
||||
|
|
Loading…
Reference in New Issue