diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 67c3bfbe2..f75dacecc 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -207,7 +207,7 @@ class ShixunsController < ApplicationController @new_shixun = Shixun.new @new_shixun.attributes = @shixun.attributes.dup.except("id","user_id","visits","gpid","status", "identifier", "averge_star", "homepage_show","repo_name", "myshixuns_count", "challenges_count", - "can_copy", "created_at", "updated_at") + "can_copy", "created_at", "updated_at", "public") @new_shixun.user_id = User.current.id @new_shixun.averge_star = 5 @new_shixun.identifier = generate_identifier Shixun, 8 diff --git a/app/services/subjects/copy_subject_service.rb b/app/services/subjects/copy_subject_service.rb index 94157dc7b..f44191fda 100644 --- a/app/services/subjects/copy_subject_service.rb +++ b/app/services/subjects/copy_subject_service.rb @@ -60,7 +60,7 @@ class Subjects::CopySubjectService < ApplicationService shixun = stage_shixun.shixun to_shixun = Shixun.new to_shixun.attributes = shixun.attributes.dup.except('id', 'user_id', 'identifier', 'homepage_show', - 'use_scope', 'averge_star', 'myshixuns_count', 'challenges_count') + 'use_scope', 'averge_star', 'myshixuns_count', 'challenges_count', "public") to_shixun.identifier = Util::UUID.generate_identifier(Shixun, 8) to_shixun.user_id = user.id if laboratory diff --git a/app/services/users/shixun_service.rb b/app/services/users/shixun_service.rb index ef399ce8c..279d147f4 100644 --- a/app/services/users/shixun_service.rb +++ b/app/services/users/shixun_service.rb @@ -44,7 +44,7 @@ class Users::ShixunService def user_policy_filter(relations) # 只有自己或者管理员才有过滤筛选及查看全部状态下实训功能 if self_or_admin? - relations = relations.where.not(status: -1) + relations = relations.where.not(status: -1).where(hidden: false) status_filter(relations) else relations.where(status: [2, 3], hidden: false) diff --git a/app/services/users/subject_service.rb b/app/services/users/subject_service.rb index 8a4fdce3b..53ff3f4b9 100644 --- a/app/services/users/subject_service.rb +++ b/app/services/users/subject_service.rb @@ -35,7 +35,7 @@ class Users::SubjectService def user_policy_filter(relations) # 只有自己或者管理员才有过滤筛选及查看全部状态下实训功能 if self_or_admin? - status_filter(relations) + status_filter(relations.unhidden) else relations.where(status: 2, hidden: false) end diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js index 52cf945a0..5ee763951 100644 --- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -591,7 +591,7 @@ class NewShixunModel extends Component{ this.props.type==='shixuns'? ( item.is_jupyter===true? -
+

Jupyter

diff --git a/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css b/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css index b69c41e25..9bdf44e68 100644 --- a/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css +++ b/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css @@ -391,7 +391,6 @@ text-align: center; border-radius:5px; border:1px solid #FF6802; - margin-top: 4px; } .myysljupytertest{ width:54px; diff --git a/public/react/src/modules/courses/elearning/YslDetailCards.js b/public/react/src/modules/courses/elearning/YslDetailCards.js index 55bed2b5e..6ca63a42a 100644 --- a/public/react/src/modules/courses/elearning/YslDetailCards.js +++ b/public/react/src/modules/courses/elearning/YslDetailCards.js @@ -529,6 +529,7 @@ class YslDetailCards extends Component{ { this.props.isAdmin()===true? {this.props.isAdmin?this.stopPro(event)} className={this.props.isAdminOrCreator()?"homepagePostSetting homepagePostSettingname":"homepagePostSetting homepagePostSettingbox"} style={{"right":"-2px","top":"6px","display":"block"}}> - {discussMessage&&discussMessage.shixun_status>1?实训详情:""} + {discussMessage&&discussMessage.shixun_status>1?实训详情: + 实训详情} {this.props.isAdminOrCreator()?this.editname(discussMessage.name,discussMessage.homework_id,event)} className={"btn colorblue ml20 font-16 fontweight400"}>重命名:""} {/* 设置*/} 设置 diff --git a/public/react/src/modules/paths/PathDetail/Addshixuns.js b/public/react/src/modules/paths/PathDetail/Addshixuns.js index 634ce281f..a4819ed76 100644 --- a/public/react/src/modules/paths/PathDetail/Addshixuns.js +++ b/public/react/src/modules/paths/PathDetail/Addshixuns.js @@ -69,6 +69,7 @@ class Addshixuns extends Component { labelCol: { span: 4 }, wrapperCol: { span: 14 }, }; + console.log(this.props) return( :""}
-
- - - 普通实训 - jupyter实训 - - -
+ {/*
*/} + {/* */} + {/* */} + {/* 普通实训*/} + {/* jupyter实训*/} + {/* */} + {/* */} + {/*
*/}

实训名称: diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index ed89de173..bf13313fd 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -1223,7 +1223,7 @@ class TPMBanner extends Component { } - {this.props.identity < 8 && shixunsDetails.shixun_status != -1 && shixunsDetails.shixun_status != 0? + {this.props.identity < 5 && shixunsDetails.shixun_status != -1 && shixunsDetails.shixun_status != 0?

diff --git a/public/react/src/modules/tpm/TPMsettings/Configuration.js b/public/react/src/modules/tpm/TPMsettings/Configuration.js index 79f253191..070f5b156 100644 --- a/public/react/src/modules/tpm/TPMsettings/Configuration.js +++ b/public/react/src/modules/tpm/TPMsettings/Configuration.js @@ -121,8 +121,9 @@ export default class Shixuninformation extends Component { } onSubmits = () => { - let {can_copy, use_scope, scope_partment, opening_time,oldscope_partment} = this.state; + + if(this.state.opentime===true){ if(opening_time===null){ this.setState({ @@ -143,9 +144,7 @@ export default class Shixuninformation extends Component { let id = this.props.match.params.shixunId; let url = `/shixuns/${id}/update_permission_setting.json`; - this.setState({ - loading: true - }) + axios.post(url, { scope_partment: list, @@ -168,14 +167,10 @@ export default class Shixuninformation extends Component { this.props.getdatas("3") } }).catch((error) => { - this.setState({ - loading: false - }) + }) - this.setState({ - loading: false - }) + } CheckboxonChange = (e) => { this.setState({ diff --git a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js index 2b389245b..651818da7 100644 --- a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js +++ b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js @@ -96,8 +96,8 @@ export default class TPMsettings extends Component { operateshixunstype: false, }); - // window.location.href = "/shixuns"; - this.props.history.replace( "/shixuns/"); + window.location.href = "/shixuns"; + // this.props.history.replace( "/shixuns/"); } }).catch((error) => { console.log(error) @@ -114,8 +114,8 @@ export default class TPMsettings extends Component { operateshixunstype: false, }); - // window.location.href = "/shixuns/" + id + "/challenges"; - this.props.history.replace( "/shixuns/" + id + "/challenges"); + window.location.href = "/shixuns/" + id + "/challenges"; + // this.props.history.replace( "/shixuns/" + id + "/challenges"); } }).catch((error) => { console.log(error) diff --git a/public/react/src/modules/tpm/newshixuns/Newshixuns.js b/public/react/src/modules/tpm/newshixuns/Newshixuns.js index c2ec0d5ef..8355efb52 100644 --- a/public/react/src/modules/tpm/newshixuns/Newshixuns.js +++ b/public/react/src/modules/tpm/newshixuns/Newshixuns.js @@ -431,6 +431,7 @@ class Newshixuns extends Component { return isLt150M; }, } + return (