From fbc66484a0ecc2c3c7159364430349a521923c28 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 3 Nov 2014 10:12:22 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=82=E4=BD=9C=E4=B8=9A=E5=A4=84=E4=BA=8E?= =?UTF-8?q?=E5=8C=BF=E8=AF=84=E9=98=B6=E6=AE=B5=E6=97=B6=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E6=89=8D=E5=8F=AF=E5=AF=B9=E4=BD=9C=E4=B8=9A=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E8=AF=84=E5=88=86=EF=BC=8C=E5=90=A6=E5=88=99=E4=B8=8D=E5=8F=AF?= =?UTF-8?q?=E5=AF=B9=E4=BD=9C=E4=B8=9A=E8=BF=9B=E8=A1=8C=E8=AF=84=E5=88=86?= =?UTF-8?q?=202=E3=80=82=E4=BD=9C=E4=B8=9A=E5=A4=84=E4=BA=8E=E5=8C=BF?= =?UTF-8?q?=E8=AF=84=E9=98=B6=E6=AE=B5=E4=B8=94=E5=8C=BF=E8=AF=84=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E5=88=97=E8=A1=A8=E4=B8=8D=E4=B8=BA=E7=A9=BA=E6=97=B6?= =?UTF-8?q?=E6=89=8D=E7=BB=99=E7=94=A8=E6=88=B7=E5=BC=B9=E5=87=BA=E5=8C=BF?= =?UTF-8?q?=E8=AF=84=E6=8F=90=E7=A4=BA=203=E3=80=82=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=B7=B2=E5=85=B3=E9=97=AD=E5=8C=BF=E8=AF=84=E4=B8=BA=E5=8C=BF?= =?UTF-8?q?=E8=AF=84=E7=BB=93=E6=9D=9F?= 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/_homework.html.erb | 3 ++- app/views/bids/_homework_list.html.erb | 9 ++++--- app/views/homework_attach/_homework.html.erb | 25 ++++++++++++++------ 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/app/views/bids/_bid_homework_show.html.erb b/app/views/bids/_bid_homework_show.html.erb index ad6b2e504..0c38335bf 100644 --- a/app/views/bids/_bid_homework_show.html.erb +++ b/app/views/bids/_bid_homework_show.html.erb @@ -41,7 +41,7 @@ <% when 1 %> <%= link_to '关闭匿评', stop_anonymous_comment_bid_path(bid), id: "#{bid.id}_stop_anonymous_comment", remote: true %> <% when 2 %> - 已关闭匿评 + 匿评结束 <% end %> <%= link_to( diff --git a/app/views/bids/_homework.html.erb b/app/views/bids/_homework.html.erb index 0b38d07d9..9265f23f0 100644 --- a/app/views/bids/_homework.html.erb +++ b/app/views/bids/_homework.html.erb @@ -29,7 +29,8 @@ window.onready = function() { - <% if !@is_teacher && @homework_list.count > 0%> + <% if !@is_teacher && @homework_list.count > 0 && @bid.comment_status == 1%> + //登录者不是老师,且作业列表数目不为0,且作业处于开启匿评阶段 $('#ajax-modal').html('<%= escape_javascript(render :partial => 'homework_attach/praise_alert') %>'); showModal('ajax-modal', '480px'); $('#ajax-modal').css('height','240px'); diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb index 828474acb..2b7b87b0f 100644 --- a/app/views/bids/_homework_list.html.erb +++ b/app/views/bids/_homework_list.html.erb @@ -34,9 +34,12 @@
  • <%= link_to "我的作品", get_my_homework_homework_attach_index_path(:bid_id => @bid.id), {:remote => true}%>
  • -
  • - <%= link_to "所有作品", get_homeworks_homework_attach_index_path(:bid_id => @bid.id), {:remote => true}%> -
  • + <% if @bid.comment_status == 2 %> + +
  • + <%= link_to "所有作品", get_homeworks_homework_attach_index_path(:bid_id => @bid.id), {:remote => true}%> +
  • + <% end %>
  • <%= link_to "留言", get_homework_jours_homework_attach_index_path(:bid_id => @bid.id), {:remote => true}%> ( diff --git a/app/views/homework_attach/_homework.html.erb b/app/views/homework_attach/_homework.html.erb index e9252edf3..c6b7895cc 100644 --- a/app/views/homework_attach/_homework.html.erb +++ b/app/views/homework_attach/_homework.html.erb @@ -61,13 +61,24 @@ <% end %>
  • <% elsif is_student_batch_homework%> - -
  • - <%= link_to l(:label_work_rating),homework_attach_path(homework),:remote => true %> - <% if Time.parse(@bid.deadline.to_s).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %> -   迟交! - <% end %> -
  • + + <% if @bid.comment_status == 1 %> + +
  • + <%= link_to l(:label_work_rating),homework_attach_path(homework),:remote => true %> + <% if Time.parse(@bid.deadline.to_s).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %> +   迟交! + <% end %> +
  • + <% elsif @bid.comment_status == 2%> + +
  • + 评分 + <% if Time.parse(@bid.deadline.to_s).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %> +   迟交! + <% end %> +
  • + <% end %> <% else %>