From 30ebe9b2d53469b1404f14828f7149a341497171 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 11 Sep 2015 09:59:34 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E7=BC=96=E7=A8=8B=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E5=BC=80=E5=90=AF=E5=8C=BF=E8=AF=84=202?= =?UTF-8?q?=E3=80=81=E5=8F=96=E6=B6=88=E6=89=A3=E5=88=86=E6=A0=87=E5=87=86?= =?UTF-8?q?=E7=9A=84=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 36 +++++++++++++----------- app/views/homework_common/index.html.erb | 14 ++++----- app/views/student_work/index.html.erb | 14 ++++----- 3 files changed, 33 insertions(+), 31 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4c78c03df..a1663c76b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2297,25 +2297,27 @@ module ApplicationHelper #获取匿评相关连接代码 def homework_anonymous_comment homework - if homework.homework_type == 1 && homework.homework_detail_manual #匿评作业 - if Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") - link = "启动匿评".html_safe - elsif homework.student_works.count >= 2 #作业份数大于2 - case homework.homework_detail_manual.comment_status - when 1 - link = link_to '启动匿评', alert_anonymous_comment_homework_common_path(homework), id: "#{homework.id}_start_anonymous_comment", remote: true, disable_with: '加载中...',:class => 'fr mr10 work_edit' - when 2 - link = link_to '关闭匿评', alert_anonymous_comment_homework_common_path(homework), id: "#{homework.id}_stop_anonymous_comment", remote: true,:class => 'fr mr10 work_edit' - when 3 - link = "匿评结束".html_safe - end - else - link = "启动匿评".html_safe + # if homework.homework_type == 1 && homework.homework_detail_manual #匿评作业 + # + # elsif homework.homework_type == 2 && homework.homework_detail_programing #编程作业作业 + # link = "编程作业".html_safe + # else + # link = "启动匿评".html_safe + # end + + if Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") + link = "启动匿评".html_safe + elsif homework.student_works.count >= 2 #作业份数大于2 + case homework.homework_detail_manual.comment_status + when 1 + link = link_to '启动匿评', alert_anonymous_comment_homework_common_path(homework), id: "#{homework.id}_start_anonymous_comment", remote: true, disable_with: '加载中...',:class => 'fr mr10 work_edit' + when 2 + link = link_to '关闭匿评', alert_anonymous_comment_homework_common_path(homework), id: "#{homework.id}_stop_anonymous_comment", remote: true,:class => 'fr mr10 work_edit' + when 3 + link = "匿评结束".html_safe end - elsif homework.homework_type == 2 && homework.homework_detail_programing #编程作业作业 - link = "编程作业".html_safe else - link = "启动匿评".html_safe + link = "启动匿评".html_safe end link end diff --git a/app/views/homework_common/index.html.erb b/app/views/homework_common/index.html.erb index bbf4aa343..694069b44 100644 --- a/app/views/homework_common/index.html.erb +++ b/app/views/homework_common/index.html.erb @@ -98,17 +98,17 @@
<% end%> -
+ <%= l(:label_end_time)%>:<%= homework.end_time%> <% if betweentime(homework.end_time) < 0 %> diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index 776af3b3e..e8fa33902 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -185,18 +185,18 @@
-
+ 截止时间:<%= @homework.end_time%>
<% if betweentime(@homework.end_time) < 0 %>