From 4662edde1abc705388348fb57c9ae8d7d3a70908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 31 Jul 2019 17:05:34 +0800 Subject: [PATCH 01/10] b --- .../PackageIndex/PackageConcent.js | 69 +++++++++++++++++-- 1 file changed, 64 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/projectPackages/PackageIndex/PackageConcent.js b/public/react/src/modules/projectPackages/PackageIndex/PackageConcent.js index 692cfc330..1a2ba1723 100644 --- a/public/react/src/modules/projectPackages/PackageIndex/PackageConcent.js +++ b/public/react/src/modules/projectPackages/PackageIndex/PackageConcent.js @@ -4,6 +4,9 @@ import axios from 'axios'; import { Input ,Icon,Button,Pagination} from 'antd'; import moment from 'moment'; import '../packageconcnet.css'; +import AccountProfile from"../../user/AccountProfile"; +import LoginDialog from '../../login/LoginDialog'; + const { Search } = Input; let categorylist=[ @@ -45,7 +48,9 @@ class PackageConcent extends Component { sort_direction:"desc", page:1, per_page:20, - categories:[] + categories:[], + isRender:false, + AccountProfiletype:false } } //desc’, ‘desc’, ‘asc’ @@ -134,12 +139,66 @@ class PackageConcent extends Component { this.setdatas(category,keyword,value,sort_directionvalue,page) } + + onReleaseRequirements=(url)=>{ + + 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 { From cfa04473057e6cb6b6e4e4bfc6833e7a534a951c Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 31 Jul 2019 17:25:07 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E8=A7=86=E9=A2=91=E7=B1=BB=E5=AE=9E?= =?UTF-8?q?=E8=AE=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/games/picture_display.json.jbuilder | 45 +++++++++---------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/app/views/games/picture_display.json.jbuilder b/app/views/games/picture_display.json.jbuilder index b43efa57e..35caba063 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 + # 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.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 + 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 From 8a82ff1521b123bc5198dc3381aabd263f6ed4c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 31 Jul 2019 17:25:42 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/App.js | 4 +- .../projectPackages/ProjectPackageIndex.js | 46 +++++++++---------- .../tpm/challengesnew/TPMevaluation.js | 4 +- 3 files changed, 27 insertions(+), 27 deletions(-) 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/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/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)}>
Date: Wed, 31 Jul 2019 17:30:06 +0800 Subject: [PATCH 04/10] b --- public/react/src/modules/tpm/NewHeader.js | 2 +- .../react/src/modules/user/usersInfo/Infos.js | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) 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/user/usersInfo/Infos.js b/public/react/src/modules/user/usersInfo/Infos.js index 5286c5797..31fef9070 100644 --- a/public/react/src/modules/user/usersInfo/Infos.js +++ b/public/react/src/modules/user/usersInfo/Infos.js @@ -384,11 +384,11 @@ class Infos extends Component{ to={`/users/${username}/projects`}>项目 -
  • - 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 */} From 4bc7518067df5479b25eeb3c02b13d795ab91c75 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 31 Jul 2019 17:30:55 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E5=9B=BE=E7=89=87=E7=B1=BB=E5=AE=9E?= =?UTF-8?q?=E8=AE=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/games/picture_display.json.jbuilder | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/games/picture_display.json.jbuilder b/app/views/games/picture_display.json.jbuilder index 35caba063..770f0d71b 100644 --- a/app/views/games/picture_display.json.jbuilder +++ b/app/views/games/picture_display.json.jbuilder @@ -48,5 +48,5 @@ elsif @type == "mp3" || @type == "mp4" json.array! @answer_picture do |file| json.file_url attachment_show_users_path(:file_name => file, :path => @answer_path) end - # end + end end \ No newline at end of file From 9bd8844c2d293c89d341f20ac79b6b073bab2a5e Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Wed, 31 Jul 2019 17:53:52 +0800 Subject: [PATCH 06/10] white-space: pre; --- public/react/src/App.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/react/src/App.css b/public/react/src/App.css index c41e039c4..9d06bfc94 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 { + white-space: pre; } \ No newline at end of file From c499a1dd6983e4b32bba1fef77247a989ec8db6b Mon Sep 17 00:00:00 2001 From: p31729568 Date: Wed, 31 Jul 2019 18:18:43 +0800 Subject: [PATCH 07/10] fix join project api route --- config/routes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 1498266969b87ee14425d731458099714b94bef3 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Wed, 31 Jul 2019 19:16:41 +0800 Subject: [PATCH 08/10] fix join project apply api --- app/services/projects/apply_join_service.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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)) From a3c674e28e9046a2c9a9d8c2d0d8f54aa9ac464b Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 1 Aug 2019 09:17:32 +0800 Subject: [PATCH 09/10] # --- public/react/src/common/TextUtil.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(' Date: Thu, 1 Aug 2019 09:21:29 +0800 Subject: [PATCH 10/10] p --- public/react/src/App.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/App.css b/public/react/src/App.css index 9d06bfc94..6f63551c6 100644 --- a/public/react/src/App.css +++ b/public/react/src/App.css @@ -52,6 +52,6 @@ html, body { color: #f5222d; } /* md多空格 */ -.markdown-body { - white-space: pre; +.markdown-body p { + white-space: pre-wrap; } \ No newline at end of file