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

dev_hss
杨树明 6 years ago
commit 959cd87fa7

@ -1,7 +1,7 @@
#encoding: UTF-8 #encoding: UTF-8
class ExerciseBanksController < ApplicationController class ExerciseBanksController < ApplicationController
before_action :require_login 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 :bank_admin, only: [:update]
before_action :commit_shixun_present, only: [:commit_shixun] before_action :commit_shixun_present, only: [:commit_shixun]

@ -1,6 +1,6 @@
class GtopicBanksController < ApplicationController class GtopicBanksController < ApplicationController
before_action :require_login before_action :require_login
before_action :find_bank before_action :find_bank, :bank_visit_auth
before_action :bank_admin, only: [:edit, :update] before_action :bank_admin, only: [:edit, :update]
def show def show

@ -1,6 +1,6 @@
class HomeworkBanksController < ApplicationController class HomeworkBanksController < ApplicationController
before_action :require_login before_action :require_login
before_action :find_bank before_action :find_bank, :bank_visit_auth
before_action :bank_params, only: [:update] before_action :bank_params, only: [:update]
before_action :bank_admin, only: [:update, :destroy, :set_public] before_action :bank_admin, only: [:update, :destroy, :set_public]

@ -1,6 +1,6 @@
class TaskBanksController < ApplicationController class TaskBanksController < ApplicationController
before_action :require_login before_action :require_login
before_action :find_bank before_action :find_bank, :bank_visit_auth
before_action :bank_visit_auth before_action :bank_visit_auth
before_action :bank_admin, only: [:update] before_action :bank_admin, only: [:update]

@ -86,7 +86,7 @@ module TidingDecorator
def teacher_join_course_content def teacher_join_course_content
name = Course.find_by(id: container_id)&.name 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 end
def apply_add_department_content def apply_add_department_content

@ -110,6 +110,8 @@ class NewWorkForm extends Component{
{/* min={has_commit ? init_max_num : (min_num == undefined ? 2 : min_num + 1) } */} {/* 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; const { has_commit, max_num, init_max_num, min_num, init_min_num } = this.state;
const isGroup = this.props.isGroup()
if (isGroup) {
if (!min_num) { if (!min_num) {
this.props.showNotification('最小人数不能为空'); this.props.showNotification('最小人数不能为空');
return; return;
@ -123,12 +125,14 @@ class NewWorkForm extends Component{
this.props.showNotification('最大人数不能小于最小人数'); this.props.showNotification('最大人数不能小于最小人数');
return; return;
} }
if (has_commit) { if (has_commit) {
if (max_num < init_max_num || min_num > init_min_num) { if (max_num < init_max_num || min_num > init_min_num) {
this.props.showNotification(`已有提交作品,人数范围只能扩大(原设置为:${init_min_num} - ${init_max_num})`) this.props.showNotification(`已有提交作品,人数范围只能扩大(原设置为:${init_min_num} - ${init_max_num})`)
return; return;
} }
} }
}
// const errKeys = Object.keys(err); // || errKeys.length == 1 && errKeys[0] == 'content' && mdContnet // const errKeys = Object.keys(err); // || errKeys.length == 1 && errKeys[0] == 'content' && mdContnet
if (!err) { if (!err) {

Loading…
Cancel
Save