关闭匿评功能

This commit is contained in:
sw 2015-05-26 11:24:48 +08:00
parent 96354a1c00
commit f3246b99c9
2 changed files with 7 additions and 2 deletions

View File

@ -1,7 +1,7 @@
class HomeworkCommonController < ApplicationController class HomeworkCommonController < ApplicationController
layout "base_courses" layout "base_courses"
before_filter :find_course, :only => [:index,:new,:create] before_filter :find_course, :only => [:index,:new,:create]
before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment] before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment]
before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment] before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment]
def index def index
@ -152,7 +152,10 @@ class HomeworkCommonController < ApplicationController
#关闭匿评 #关闭匿评
def stop_anonymous_comment def stop_anonymous_comment
@homework_detail_manual.update_column('comment_status', 3)
respond_to do |format|
format.js
end
end end
#提示 #提示

View File

@ -0,0 +1,2 @@
$("#<%= @homework.id %>_stop_anonymous_comment").replaceWith('<span class="fr pr_join_span mr10" title="匿评结束">匿评结束</span>');
alert('关闭成功');