From 4a6909b59f32a697624a4d8997aa757339a9f5a4 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 21 Jun 2019 11:19:21 +0800 Subject: [PATCH] =?UTF-8?q?D=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/graduation_tasks_helper.rb | 2 +- app/views/graduation_tasks/tasks_list.json.jbuilder | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/graduation_tasks_helper.rb b/app/helpers/graduation_tasks_helper.rb index 5253b0d56..a5f05d623 100644 --- a/app/helpers/graduation_tasks_helper.rb +++ b/app/helpers/graduation_tasks_helper.rb @@ -14,7 +14,7 @@ module GraduationTasksHelper # 交叉评阅 def cross_comment task, user_id - if task.cross_comment + if task.cross_comment && task.status >= 3 [{id: 1, name: "只看我的交叉评阅", count: task.graduation_work_comment_assignations.myself(user_id).count}] else [] diff --git a/app/views/graduation_tasks/tasks_list.json.jbuilder b/app/views/graduation_tasks/tasks_list.json.jbuilder index cda1eb6d4..fe7ffddc4 100644 --- a/app/views/graduation_tasks/tasks_list.json.jbuilder +++ b/app/views/graduation_tasks/tasks_list.json.jbuilder @@ -9,7 +9,7 @@ if @task.published? || @user_course_identity < Course::STUDENT json.teacher_comment teacher_comment @task, @current_user.id json.task_status task_status @task, @current_user.id json.course_group_info course_group_info @course, @current_user.id - json.cross_comment cross_comment @task, @current_user if @task.status >= 3 + json.cross_comment cross_comment @task, @current_user end # 课堂下所有老师 TODO: 考虑以后在点击分配时,再获取老师列表 json.teacher_list do