修改重启课程

This commit is contained in:
nwb 2014-06-05 10:40:14 +08:00
parent 6a9037dde5
commit 529cf4f4f8
2 changed files with 16 additions and 1 deletions

View File

@ -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

View File

@ -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 %>