From 8b2d94fd95d39282a6560ba69b841f68f502dae0 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Fri, 6 Sep 2019 18:03:44 +0800 Subject: [PATCH 1/3] fix tiding --- app/decorators/tiding_decorator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/decorators/tiding_decorator.rb b/app/decorators/tiding_decorator.rb index 81093dc12..d43aa5e2d 100644 --- a/app/decorators/tiding_decorator.rb +++ b/app/decorators/tiding_decorator.rb @@ -86,7 +86,7 @@ module TidingDecorator def teacher_join_course_content name = Course.find_by(id: container_id)&.name - I18n.t(locale_format extra) % [user.show_real_name, name] + I18n.t(locale_format extra) % [trigger_user&.show_real_name, name] end def apply_add_department_content From 25168fae80ed99f4199aa28329465a4d7f479145 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 6 Sep 2019 18:10:14 +0800 Subject: [PATCH 2/3] isGroup --- .../modules/courses/busyWork/NewWorkForm.js | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/NewWorkForm.js b/public/react/src/modules/courses/busyWork/NewWorkForm.js index 33d6e4cda..6083252bc 100644 --- a/public/react/src/modules/courses/busyWork/NewWorkForm.js +++ b/public/react/src/modules/courses/busyWork/NewWorkForm.js @@ -110,23 +110,27 @@ class NewWorkForm extends Component{ {/* min={has_commit ? init_max_num : (min_num == undefined ? 2 : min_num + 1) } */} // 已有提交作品,人数范围只能扩大 const { has_commit, max_num, init_max_num, min_num, init_min_num } = this.state; - if (!min_num) { - this.props.showNotification('最小人数不能为空'); - return; - } else if (min_num < 1) { - this.props.showNotification('最小人数不能小于1'); - return; - } else if (!max_num) { - this.props.showNotification('最大人数不能为空'); - return; - } else if (max_num < min_num) { - this.props.showNotification('最大人数不能小于最小人数'); - return; - } - if (has_commit) { - if (max_num < init_max_num || min_num > init_min_num) { - this.props.showNotification(`已有提交作品,人数范围只能扩大(原设置为:${init_min_num} - ${init_max_num})`) + const isGroup = this.props.isGroup() + if (isGroup) { + if (!min_num) { + this.props.showNotification('最小人数不能为空'); return; + } else if (min_num < 1) { + this.props.showNotification('最小人数不能小于1'); + return; + } else if (!max_num) { + this.props.showNotification('最大人数不能为空'); + return; + } else if (max_num < min_num) { + this.props.showNotification('最大人数不能小于最小人数'); + return; + } + + if (has_commit) { + if (max_num < init_max_num || min_num > init_min_num) { + this.props.showNotification(`已有提交作品,人数范围只能扩大(原设置为:${init_min_num} - ${init_max_num})`) + return; + } } } From a894d27b9ae7d5c028713f2fea9b5e2a5a950ea0 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 6 Sep 2019 18:22:14 +0800 Subject: [PATCH 3/3] tiaoz --- app/controllers/exercise_banks_controller.rb | 2 +- app/controllers/gtopic_banks_controller.rb | 2 +- app/controllers/homework_banks_controller.rb | 2 +- app/controllers/task_banks_controller.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/exercise_banks_controller.rb b/app/controllers/exercise_banks_controller.rb index 160393e0c..9a35bfcdb 100644 --- a/app/controllers/exercise_banks_controller.rb +++ b/app/controllers/exercise_banks_controller.rb @@ -1,7 +1,7 @@ #encoding: UTF-8 class ExerciseBanksController < ApplicationController before_action :require_login - before_action :find_bank, except: [:choose_shixun] + before_action :find_bank, :bank_visit_auth, except: [:choose_shixun] before_action :bank_admin, only: [:update] before_action :commit_shixun_present, only: [:commit_shixun] diff --git a/app/controllers/gtopic_banks_controller.rb b/app/controllers/gtopic_banks_controller.rb index e0382b21a..f09a8554c 100644 --- a/app/controllers/gtopic_banks_controller.rb +++ b/app/controllers/gtopic_banks_controller.rb @@ -1,6 +1,6 @@ class GtopicBanksController < ApplicationController before_action :require_login - before_action :find_bank + before_action :find_bank, :bank_visit_auth before_action :bank_admin, only: [:edit, :update] def show diff --git a/app/controllers/homework_banks_controller.rb b/app/controllers/homework_banks_controller.rb index 31e733245..61bded033 100644 --- a/app/controllers/homework_banks_controller.rb +++ b/app/controllers/homework_banks_controller.rb @@ -1,6 +1,6 @@ class HomeworkBanksController < ApplicationController before_action :require_login - before_action :find_bank + before_action :find_bank, :bank_visit_auth before_action :bank_params, only: [:update] before_action :bank_admin, only: [:update, :destroy, :set_public] diff --git a/app/controllers/task_banks_controller.rb b/app/controllers/task_banks_controller.rb index 1d3aca955..b88768456 100644 --- a/app/controllers/task_banks_controller.rb +++ b/app/controllers/task_banks_controller.rb @@ -1,6 +1,6 @@ class TaskBanksController < ApplicationController before_action :require_login - before_action :find_bank + before_action :find_bank, :bank_visit_auth before_action :bank_visit_auth before_action :bank_admin, only: [:update]