diff --git a/app/services/projects/apply_join_service.rb b/app/services/projects/apply_join_service.rb index a177de930..d14b3dc52 100644 --- a/app/services/projects/apply_join_service.rb +++ b/app/services/projects/apply_join_service.rb @@ -22,7 +22,7 @@ class Projects::ApplyJoinService < ApplicationService apply.forge_activities.find_or_create_by!(user: user, project: project) - notify_project_manager! + notify_project_manager!(apply) end # notify_project_owner @@ -47,10 +47,13 @@ class Projects::ApplyJoinService < ApplicationService end end - def notify_project_manager! + def notify_project_manager!(apply) columns = %i[user_id applied_id applied_type status viewed applied_user_id role project_id created_at updated_at] AppliedMessage.bulk_insert(*columns) do |worker| - base_attr = { status: false, viewed: false, applied_user_id: user.id, role: role_value, project_id: project.id } + base_attr = { + applied_id: apply.id, applied_type: 'AppliedProject', status: false, viewed: false, + applied_user_id: user.id, role: role_value, project_id: project.id + } project.manager_members.each do |manager| worker.add(base_attr.merge(user_id: manager.user_id)) diff --git a/app/views/games/picture_display.json.jbuilder b/app/views/games/picture_display.json.jbuilder index b43efa57e..770f0d71b 100644 --- a/app/views/games/picture_display.json.jbuilder +++ b/app/views/games/picture_display.json.jbuilder @@ -25,29 +25,28 @@ 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 - # 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 + # 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 end \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 10a6160ab..79542817f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -715,7 +715,7 @@ Rails.application.routes.draw do resources :libraries, only: [:index, :show, :create, :update, :destroy] scope module: :projects do - resources :applied_projects, only: [:create] + resources :project_applies, only: [:create] end end diff --git a/public/react/src/App.css b/public/react/src/App.css index c41e039c4..6f63551c6 100644 --- a/public/react/src/App.css +++ b/public/react/src/App.css @@ -50,4 +50,8 @@ html, body { } .ant-progress-textno{ color: #f5222d; +} +/* md多空格 */ +.markdown-body p { + white-space: pre-wrap; } \ No newline at end of file diff --git a/public/react/src/App.js b/public/react/src/App.js index 2b0f23ade..895016ff7 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -292,8 +292,8 @@ class App extends Component { - {/*众包创新*/} - + {/*/!*众包创新*!/*/} + {/**/} {/*认证*/} diff --git a/public/react/src/common/TextUtil.js b/public/react/src/common/TextUtil.js index bb0b3f145..2dab5c4aa 100644 --- a/public/react/src/common/TextUtil.js +++ b/public/react/src/common/TextUtil.js @@ -9,7 +9,7 @@ export function markdownToHTML(oldContent, selector) { window.$('#md_div').html('') // markdown to html if (selector && oldContent && oldContent.startsWith('{ + + let{current_user} =this.props; + if(current_user===undefined){ + this.setState({ + isRender:true + }) + return + } + if(current_user&¤t_user.login===""){ + this.setState({ + isRender:true + }) + return; + } + + if(current_user&¤t_user.profile_completed===false){ + this.setState({ + AccountProfiletype:true + }) + return; + } + if(url !== undefined || url!==""){ + window.location.href = url; + } + + } + + // 登录 + Modifyloginvalue=()=>{ + this.setState({ + isRender:false, + }) + } + + hideAccountProfile=()=>{ + this.setState({ + AccountProfiletype:false + }) + } + render() { - let {data,page,category,sort_by,sort_direction,project_packages}=this.state; + let {data,page,category,sort_by,sort_direction,project_packages, + isRender,AccountProfiletype + }=this.state; return (
- + {isRender===true?this.Modifyloginvalue()} + {...this.state} + {...this.props} + />:""} + + {AccountProfiletype===true?this.hideAccountProfile()} + {...this.state} + {...this.props} + />:""}
@@ -158,7 +217,7 @@ class PackageConcent extends Component { enterButton={ 搜索} onSearch={ (value)=>this.setdatafuns(value)} />

@@ -224,7 +283,7 @@ class PackageConcent extends Component { diff --git a/public/react/src/modules/projectPackages/ProjectPackageIndex.js b/public/react/src/modules/projectPackages/ProjectPackageIndex.js index 097e012e0..2b8bba2bb 100644 --- a/public/react/src/modules/projectPackages/ProjectPackageIndex.js +++ b/public/react/src/modules/projectPackages/ProjectPackageIndex.js @@ -43,29 +43,29 @@ class ProjectPackageIndex extends Component { {/*众包首页*/} - () - } - > - - () - } - > - - () - } - > - - () - } - > + {/* ()*/} + {/*}*/} + {/*>*/} + + {/* ()*/} + {/*}*/} + {/*>*/} + + {/* ()*/} + {/*}*/} + {/*>*/} + + {/* ()*/} + {/*}*/} + {/*>*/}
diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index da44b0397..537489f8f 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -815,7 +815,7 @@ submittojoinclass=(value)=>{
  • 我的实训
  • 我的实践课程
  • 我的项目
  • -
  • 我的众包
  • + {/*
  • 我的众包
  • */}
  • 账号管理
  • {/*
  • this.educoderlogin()} >登入测试接口
  • */} {/*
  • this.trialapplications()} >试用申请
  • */} diff --git a/public/react/src/modules/tpm/challengesnew/TPMevaluation.js b/public/react/src/modules/tpm/challengesnew/TPMevaluation.js index 6cd0b9977..9beab2b5b 100644 --- a/public/react/src/modules/tpm/challengesnew/TPMevaluation.js +++ b/public/react/src/modules/tpm/challengesnew/TPMevaluation.js @@ -951,8 +951,8 @@ export default class TPMevaluation extends Component { - - + {/**/} + {/**/} this.showrepositoryurltip(1)}>
    项目 -
  • - this.setState({moduleName: 'package'})} - to={`/users/${username}/package`}>众包 -
  • + {/*
  • */} + {/* this.setState({moduleName: 'package'})}*/} + {/*to={`/users/${username}/package`}>众包*/} + {/*
  • */} {/*{ data && data.identity!="学生" &&
  • 题库
  • }*/} @@ -404,11 +404,11 @@ class Infos extends Component{ {/* 众包 */} {/* http://localhost:3007/courses/1309/homework/9300/setting */} - () - } - > + {/* ()*/} + {/*}*/} + {/*>*/} {/* 课堂 */} {/* http://localhost:3007/courses/1309/homework/9300/setting */}