From 1c7b6aa17ea83daf50e3a022ebe7e6f16ba4f19a Mon Sep 17 00:00:00 2001 From: gonglexin <18008490802@163.com> Date: Tue, 4 Nov 2014 19:51:24 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=BB=E6=AD=A2=E7=94=A8=E6=88=B7=E5=A4=9A?= =?UTF-8?q?=E6=AC=A1=E7=82=B9=E5=87=BB=E5=90=AF=E5=8A=A8=E5=8C=BF=E8=AF=84?= =?UTF-8?q?=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/bids/_bid_homework_show.html.erb | 2 +- app/views/bids/start_anonymous_comment.js.erb | 3 ++- app/views/layouts/base_homework.html.erb | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/views/bids/_bid_homework_show.html.erb b/app/views/bids/_bid_homework_show.html.erb index 4ed9a9015..155efe732 100644 --- a/app/views/bids/_bid_homework_show.html.erb +++ b/app/views/bids/_bid_homework_show.html.erb @@ -37,7 +37,7 @@ <% case bid.comment_status %> <% when 0 %> - <%= link_to '启动匿评', start_anonymous_comment_bid_path(bid), id: "#{bid.id}_start_anonymous_comment", remote: true, :confirm => "开启匿评后学生将不能对作业进行提交、修改、删除等操作\n是否确定开启匿评?" %> + <%= link_to '启动匿评', start_anonymous_comment_bid_path(bid), id: "#{bid.id}_start_anonymous_comment", remote: true, :confirm => "开启匿评后学生将不能对作业进行提交、修改、删除等操作\n是否确定开启匿评?", disable_with: '加载中...' %> <% when 1 %> <%= link_to '关闭匿评', stop_anonymous_comment_bid_path(bid), id: "#{bid.id}_stop_anonymous_comment", remote: true, :confirm => "关闭匿评后学生将不能对作业进行评分\n是否确定关闭匿评?" %> <% when 2 %> diff --git a/app/views/bids/start_anonymous_comment.js.erb b/app/views/bids/start_anonymous_comment.js.erb index a6e24285b..c7e2bfb40 100644 --- a/app/views/bids/start_anonymous_comment.js.erb +++ b/app/views/bids/start_anonymous_comment.js.erb @@ -1,6 +1,7 @@ <% if @statue == 1%> alert('启动成功'); - $("#<%= @bid.id %>_start_anonymous_comment").html('<%= link_to "关闭匿评", stop_anonymous_comment_bid_path(@bid), remote: true %>'); + $("#<%= @bid.id %>_start_anonymous_comment").remove(); + $("#<%= @bid.id %>_anonymous_comment").append('<%= link_to "关闭匿评", stop_anonymous_comment_bid_path(@bid), remote: true %>'); <% elsif @statue == 2 %> alert('启动失败\n作业总数大于4份时才能启动匿评'); <% elsif @statue == 3%> diff --git a/app/views/layouts/base_homework.html.erb b/app/views/layouts/base_homework.html.erb index ab3dbd750..7f88e3394 100644 --- a/app/views/layouts/base_homework.html.erb +++ b/app/views/layouts/base_homework.html.erb @@ -107,7 +107,7 @@ <% case @bid.comment_status %> <% when 0 %> - <%= link_to '启动匿评', start_anonymous_comment_bid_path(bid), id: "#{bid.id}_start_anonymous_comment", remote: true, :confirm => "开启匿评后学生将不能对作业进行提交、修改、删除等操作\n是否确定开启匿评?" %> + <%= link_to '启动匿评', start_anonymous_comment_bid_path(bid), id: "#{bid.id}_start_anonymous_comment", remote: true, :confirm => "开启匿评后学生将不能对作业进行提交、修改、删除等操作\n是否确定开启匿评?", disable_with: '加载中...' %> <% when 1 %> <%= link_to '关闭匿评', stop_anonymous_comment_bid_path(bid), id: "#{bid.id}_stop_anonymous_comment", remote: true, :confirm => "关闭匿评后学生将不能对作业进行评分\n是否确定关闭匿评?" %> <% when 2 %>