Merge remote-tracking branch 'origin/dev_aliyun' into dev_aliyun

dev_hss
杨树明 5 years ago
commit 959cd87fa7

@ -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]

@ -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

@ -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]

@ -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]

@ -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

@ -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;
}
}
}

Loading…
Cancel
Save