diff --git a/app/controllers/project_packages_controller.rb b/app/controllers/project_packages_controller.rb index de896c920..3cc7e79cb 100644 --- a/app/controllers/project_packages_controller.rb +++ b/app/controllers/project_packages_controller.rb @@ -1,7 +1,7 @@ class ProjectPackagesController < ApplicationController include PaginateHelper - before_action :require_login, :check_auth, only: %i[create update destroy] + before_action :require_login, :check_auth, only: %i[show create update destroy] helper_method :current_package, :package_manageable? diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index fca143623..913013442 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -406,9 +406,10 @@ class ShixunsController < ApplicationController end end @shixun.update_attributes(shixun_params) + logger.info("##########shixun_info_params: #{shixun_info_params}") + logger.info("##########params[:shixun_info][:evaluate_script]: #{params[:shixun_info][:evaluate_script]}") @shixun.shixun_info.update_attributes(shixun_info_params) @shixun.shixun_schools.delete_all - logger.info("##########scope_partment:###{params[:scope_partment]}") # scope_partment: 高校的名称 if params[:scope_partment].present? arr = [] diff --git a/app/controllers/tidings_controller.rb b/app/controllers/tidings_controller.rb index 795010b3f..9324b2755 100644 --- a/app/controllers/tidings_controller.rb +++ b/app/controllers/tidings_controller.rb @@ -1,6 +1,7 @@ class TidingsController < ApplicationController include PaginateHelper + before_action :require_login after_action :update_onclick_time!, only: [:index] def index diff --git a/app/views/games/picture_display.json.jbuilder b/app/views/games/picture_display.json.jbuilder index 2bc88fdf4..838cfeda0 100644 --- a/app/views/games/picture_display.json.jbuilder +++ b/app/views/games/picture_display.json.jbuilder @@ -25,28 +25,33 @@ elsif @type == "txt" elsif @type =="qrcode" json.qrcode_str @qrcode_str elsif @type == "mp3" || @type == "mp4" - if @type == "mp4" - json.orignal_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378171/123.mp4"}] - json.user_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378172/456.mp4"}] - json.answer_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378173/789.mp4"}] - else - json.orignal_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378174/58099.mp3"}] - json.user_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378175/654058514.mp3"}] - json.answer_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378175/654058514.mp3"}] - end - # json.orignal_file do - # json.array! @orignal_picture do |file| - # json.file_url attachment_show_users_path(:file_name => file, :path => @original_path) - # end + # if @type == "mp4" + # json.orignal_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378171/123.mp4"}] + # json.user_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378172/456.mp4"}] + # json.answer_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378173/789.mp4"}] + # else + # json.orignal_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378174/58099.mp3"}] + # json.user_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378175/654058514.mp3"}] + # json.answer_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378175/654058514.mp3"}] # end + json.orignal_file do + json.array! @orignal_picture do |file| + json.file_url attachment_show_users_path(:file_name => file, :path => @original_path) + end + end # json.user_file do # json.array! @user_picture do |file| # json.file_url attachment_show_users_path(:file_name => file, :path => @user_path, :time => Time.now.to_i) # end # end - # json.answer_file do - # json.array! @answer_picture do |file| - # json.file_url attachment_show_users_path(:file_name => file, :path => @answer_path) - # end - # end + if @type == "mp4" + json.user_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378172/456.mp4"}] + else + json.user_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378175/654058514.mp3"}] + end + json.answer_file do + json.array! @answer_picture do |file| + json.file_url attachment_show_users_path(:file_name => file, :path => @answer_path) + end + end end \ No newline at end of file diff --git a/app/views/libraries/show.json.jbuilder b/app/views/libraries/show.json.jbuilder index a5181b548..fd20d7bf2 100644 --- a/app/views/libraries/show.json.jbuilder +++ b/app/views/libraries/show.json.jbuilder @@ -38,7 +38,7 @@ json.operation do json.can_deletable manageable json.can_editable manageable - json.user_praised PraiseTread.exists?(user_id: current_user&.id) + json.user_praised library.praise_treads.exists?(user_id: current_user&.id) else json.can_deletable false json.can_editable false diff --git a/app/views/tidings/_tiding.json.jbuilder b/app/views/tidings/_tiding.json.jbuilder index cdaa48299..4a392edfd 100644 --- a/app/views/tidings/_tiding.json.jbuilder +++ b/app/views/tidings/_tiding.json.jbuilder @@ -1,4 +1,5 @@ -json.extract! tiding, :id, :status, :viewed, :user_id, :tiding_type, :container_id, :container_type, :parent_container_id, :parent_container_type +json.extract! tiding, :id, :status, :viewed, :user_id, :tiding_type, :container_id, :container_type, + :parent_container_id, :parent_container_type, :belong_container_id, :belong_container_type json.content tiding.content json.identifier tiding.identifier diff --git a/public/react/public/css/edu-all.css b/public/react/public/css/edu-all.css index 458a93324..48b102ce3 100644 --- a/public/react/public/css/edu-all.css +++ b/public/react/public/css/edu-all.css @@ -577,7 +577,7 @@ p .activity-item:first-child{border-top: 1px solid #eee;} .recently_name{float: left;line-height: 48px;display: block} .recently_item:hover{background-color: #F9F9F9;} /*私信对话框*/ -.private-list{min-height: 660px;max-height: 831px;overflow-y: auto} +.private-list{min-height: 660px;max-height: 831px;overflow-y: auto;overflow-x: hidden;} .private-list .private-part{padding-left:20px;cursor: pointer} .private-part:hover{background-color: #F5F5F5;} .private-part.active{background-color: #F5F5F5;} diff --git a/public/react/src/common/components/media/Clappr.js b/public/react/src/common/components/media/Clappr.js index 2c4d89e92..312ea9007 100644 --- a/public/react/src/common/components/media/Clappr.js +++ b/public/react/src/common/components/media/Clappr.js @@ -90,12 +90,19 @@ class Clappr extends Component{ {/* https://github.com/CookPete/react-player/issues/686 */} + {/*
*/} + + {/* 原生 */} + {/* { type == 'mp3' ? + : } */}
) } diff --git a/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js b/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js index 13bec2dd9..2eee9d882 100644 --- a/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js +++ b/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js @@ -55,9 +55,11 @@ class PackageIndexNEITaskDetails extends Component { getdatas=()=>{ let url =`/project_packages/${this.props.match.params.id}.json`; axios.get(url).then((response) => { - this.setState({ - data:response.data - }) + if(response.data.status!=401&&response.data.status!=403&&response.data.status!=408&&response.data.status!=409)[ + this.setState({ + data:response.data + }) + ] }).catch((error) => { console.log(error); @@ -236,8 +238,12 @@ class PackageIndexNEITaskDetails extends Component { render() { let {overtype,data}=this.state; - // console.log(data&&data.creator.login) - console.log(data) + // console.log(data&&data.creator.id) + let datalogin=data&&data.creator.id; + let userlogin=this.props.current_user&&this.props.current_user.user_id; + + console.log(datalogin===userlogin) + // console.log(this.props.current_user&&this.props.current_user.user_id) return ( data===undefined?"":
@@ -258,11 +264,9 @@ class PackageIndexNEITaskDetails extends Component { {data&&data.title} - 返回 + 返回
- -

- +

@@ -289,12 +293,12 @@ class PackageIndexNEITaskDetails extends Component { {data&&data.creator.name}
- {data&&data.creator.login===this.props.current_user&&this.props.current_user.login?"":
- {overtype===false? 头像联系TA: - 头像 头像联系TA: + 头像联系TA}
}
@@ -304,7 +308,7 @@ class PackageIndexNEITaskDetails extends Component {
-
+
:""}

{item.name}

- {this.props.current_user&&this.props.current_user.login!=item.login? + {this.props.current_user&&this.props.current_user.login!=item.login? 头像联系TA :""}
diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index d0a80e1f6..c75eb3071 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -692,7 +692,7 @@ class TPMBanner extends Component {
{ - startbtn === false ? + startbtn === false && shixunsDetails.shixun_status != -1 ? 发送至 @@ -921,7 +921,12 @@ class TPMBanner extends Component { 已关闭 } - {this.props.identity < 8?
已删除 + } + + + {this.props.identity < 8&&shixunsDetails.shixun_status != -1 ?
{ + + if(this.state.status===-1){ + this.props.showSnackbar("该实训已被删除,保存失败!"); + return + } + let { name, choice_main_type, choice_small_type, choice_standard_scripts, scope_partment, choice_standard_scriptssum, evaluate_script, webssh, use_scope, trainee, can_copy, task_pass, test_set_permission, hide_code, code_hidden, forbid_copy, vnc,multi_webssh, @@ -739,13 +745,15 @@ export default class TPMsettings extends Component { return v1 }); - let operateauthority=this.props.identity<5&&this.state.status==0||this.props.identity===1&&this.state.status==2||this.props.identity===1&&this.state.status==1; + // let operateauthority= + // this.props.identity===1?true:this.props.identity<5&&this.state.status==0?true:false; + // this.props.identity<5&&this.state.status==0||this.props.identity===1&&this.state.status==2||this.props.identity===1&&this.state.status==1; const description_editormd = this.description_editormd.getValue(); let evaluate_script_editormd; - if(operateauthority===true){ + if(this.state.status==0||this.state.status==1||this.state.status==2&&this.props.identity===1){ // evaluate_script_editormd = this.evaluate_script_editormd.getValue(); evaluate_script_editormd = shixunmemoMDvalue }else{ @@ -753,6 +761,7 @@ export default class TPMsettings extends Component { } + if (name === "") { this.setState({ shixunnametype: true @@ -826,6 +835,7 @@ export default class TPMsettings extends Component { if(newmulti_webssh===null){ newmulti_webssh=false } + //exec_time: exec_time, let Url = `/shixuns/` + id + `.json`; let data = { @@ -1625,8 +1635,8 @@ export default class TPMsettings extends Component { options={ { selectOnLineNumbers: true }} - onChange={operateauthority===true?this.getshixunmemoMDvalue:""} + // onChange={this.getshixunmemoMDvalue} />
diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index e8504c02b..1889df4a5 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -580,7 +580,7 @@ p .activity-item:first-child{border-top: 1px solid #eee;} .recently_name{float: left;line-height: 48px;display: block} .recently_item:hover{background-color: #F9F9F9;} /*私信对话框*/ -.private-list{min-height: 660px;max-height: 831px;overflow-y: auto} +.private-list{min-height: 660px;max-height: 831px;overflow-y: auto;overflow-x: hidden;} .private-list .private-part{padding-left:20px;cursor: pointer} .private-part:hover{background-color: #F5F5F5;} .private-part.active{background-color: #F5F5F5;} @@ -3122,7 +3122,7 @@ a.singlepublishtwo{ height: 40px; } .project-package-item .item-head-title { - max-width: 700px; + max-width: 650px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; @@ -3213,7 +3213,7 @@ a.singlepublishtwo{ font-size: 20px; } .project-package-item.with-operator:hover .item-head-title { - max-width: 600px; + max-width: 650px; } .list-count {