From 09f89f23a1ba39ff0f47861a671c93ed1e3d85f3 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 5 Nov 2014 14:51:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=BD=9C=E4=B8=9A=E6=80=BB?= =?UTF-8?q?=E7=AE=97=E5=A4=A7=E4=BA=8E2=E4=BB=BD=E6=98=AF=E6=89=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=BC=80=E5=90=AF=E5=8C=BF=E8=AF=84=E6=8C=89?= =?UTF-8?q?=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/bids/_bid_homework_show.html.erb | 22 ++++++++++++---------- app/views/layouts/base_homework.html.erb | 2 +- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/app/views/bids/_bid_homework_show.html.erb b/app/views/bids/_bid_homework_show.html.erb index bf5f700cb..c67460fef 100644 --- a/app/views/bids/_bid_homework_show.html.erb +++ b/app/views/bids/_bid_homework_show.html.erb @@ -39,17 +39,19 @@ <% end %> <% end %> - <% if (User.current.admin?||User.current.id==bid.author_id) %> - - <% case bid.comment_status %> - <% when 0 %> - <%= 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 %> - 匿评结束 + <% if (User.current.admin?||User.current.id==bid.author_id)%> + <% if bid.homeworks.count >= 2 %> + + <% case bid.comment_status %> + <% when 0 %> + <%= 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 %> + 匿评结束 + <% end %> + <% end %> - <%= link_to( l(:button_edit), {:action => 'edit', :controller=>'bids', :course_id =>@course.id, :bid_id => bid.id}, diff --git a/app/views/layouts/base_homework.html.erb b/app/views/layouts/base_homework.html.erb index 82ede60ca..01f99ce10 100644 --- a/app/views/layouts/base_homework.html.erb +++ b/app/views/layouts/base_homework.html.erb @@ -103,7 +103,7 @@