Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_admin
cxt 6 years ago
commit ff00e7491b

@ -22,7 +22,7 @@ class Projects::ApplyJoinService < ApplicationService
apply.forge_activities.find_or_create_by!(user: user, project: project) apply.forge_activities.find_or_create_by!(user: user, project: project)
notify_project_manager! notify_project_manager!(apply)
end end
# notify_project_owner # notify_project_owner
@ -47,10 +47,13 @@ class Projects::ApplyJoinService < ApplicationService
end end
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] 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| 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| project.manager_members.each do |manager|
worker.add(base_attr.merge(user_id: manager.user_id)) worker.add(base_attr.merge(user_id: manager.user_id))

@ -25,29 +25,28 @@ elsif @type == "txt"
elsif @type =="qrcode" elsif @type =="qrcode"
json.qrcode_str @qrcode_str json.qrcode_str @qrcode_str
elsif @type == "mp3" || @type == "mp4" elsif @type == "mp3" || @type == "mp4"
if @type == "mp4" # if @type == "mp4"
json.orignal_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378171/123.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.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"}] # json.answer_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378173/789.mp4"}]
else # else
json.orignal_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378174/58099.mp3"}] # 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.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"}] # 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
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 end

@ -715,7 +715,7 @@ Rails.application.routes.draw do
resources :libraries, only: [:index, :show, :create, :update, :destroy] resources :libraries, only: [:index, :show, :create, :update, :destroy]
scope module: :projects do scope module: :projects do
resources :applied_projects, only: [:create] resources :project_applies, only: [:create]
end end
end end

@ -50,4 +50,8 @@ html, body {
} }
.ant-progress-textno{ .ant-progress-textno{
color: #f5222d; color: #f5222d;
}
/* md多空格 */
.markdown-body p {
white-space: pre-wrap;
} }

@ -292,8 +292,8 @@ class App extends Component {
<Router> <Router>
<Switch> <Switch>
{/*众包创新*/} {/*/!*众包创新*!/*/}
<Route path={"/crowdsourcing"} component={ProjectPackages}/> {/*<Route path={"/crowdsourcing"} component={ProjectPackages}/>*/}
{/*认证*/} {/*认证*/}
<Route path="/account" component={AccountPage}/> <Route path="/account" component={AccountPage}/>

@ -9,7 +9,7 @@ export function markdownToHTML(oldContent, selector) {
window.$('#md_div').html('') window.$('#md_div').html('')
// markdown to html // markdown to html
if (selector && oldContent && oldContent.startsWith('<p')) { // 普通html处理 if (selector && oldContent && oldContent.startsWith('<p')) { // 普通html处理
window.$(selector).html(oldContent) window.$('#' + selector).html(oldContent)
} else { } else {
try { try {
// selector || // selector ||

@ -4,6 +4,9 @@ import axios from 'axios';
import { Input ,Icon,Button,Pagination} from 'antd'; import { Input ,Icon,Button,Pagination} from 'antd';
import moment from 'moment'; import moment from 'moment';
import '../packageconcnet.css'; import '../packageconcnet.css';
import AccountProfile from"../../user/AccountProfile";
import LoginDialog from '../../login/LoginDialog';
const { Search } = Input; const { Search } = Input;
let categorylist=[ let categorylist=[
@ -45,7 +48,9 @@ class PackageConcent extends Component {
sort_direction:"desc", sort_direction:"desc",
page:1, page:1,
per_page:20, per_page:20,
categories:[] categories:[],
isRender:false,
AccountProfiletype:false
} }
} }
//desc, desc, asc //desc, desc, asc
@ -134,12 +139,66 @@ class PackageConcent extends Component {
this.setdatas(category,keyword,value,sort_directionvalue,page) 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&&current_user.login===""){
this.setState({
isRender:true
})
return;
}
if(current_user&&current_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() { 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 ( return (
<div className="educontent clearfix mtf10" style={{flex: "1 0 auto"}}> <div className="educontent clearfix mtf10" style={{flex: "1 0 auto"}}>
{isRender===true?<LoginDialog
Modifyloginvalue={()=>this.Modifyloginvalue()}
{...this.state}
{...this.props}
/>:""}
{AccountProfiletype===true?<AccountProfile
hideAccountProfile={()=>this.hideAccountProfile()}
{...this.state}
{...this.props}
/>:""}
<div className="stud-class-set"> <div className="stud-class-set">
<div className="news"> <div className="news">
<div className="edu-class-inner container clearfix"> <div className="edu-class-inner container clearfix">
@ -158,7 +217,7 @@ class PackageConcent extends Component {
enterButton={<span><Icon type="search" className="mr5"/> 搜索</span>} enterButton={<span><Icon type="search" className="mr5"/> 搜索</span>}
onSearch={ (value)=>this.setdatafuns(value)} /> onSearch={ (value)=>this.setdatafuns(value)} />
<Button type="primary" className="setissues fr" size={"large"}> <Button type="primary" className="setissues fr" size={"large"}>
<a href="/crowdsourcing/new" >发布需求</a> <a onClick={()=>this.onReleaseRequirements("/crowdsourcing/new")}>发布需求</a>
</Button> </Button>
</p> </p>
</p> </p>
@ -224,7 +283,7 @@ class PackageConcent extends Component {
<div className=" item-head-title"> <div className=" item-head-title">
<a className={"fl mt3 font-20 font-bd color-dark maxwidth700 "} <a className={"fl mt3 font-20 font-bd color-dark maxwidth700 "}
href={"/crowdsourcing/"+item.id} onClick={()=>this.onReleaseRequirements("/crowdsourcing/"+item.id)}
title={item.title} title={item.title}
>{item.title}</a> >{item.title}</a>
</div> </div>

@ -43,29 +43,29 @@ class ProjectPackageIndex extends Component {
<Switch> <Switch>
{/*众包首页*/} {/*众包首页*/}
<Route path="/crowdsourcing/:id/edit" {/*<Route path="/crowdsourcing/:id/edit"*/}
render={ {/*render={*/}
(props) => (<PackageIndexNewandEdit {...this.props} {...props} {...this.state} />) {/*(props) => (<PackageIndexNewandEdit {...this.props} {...props} {...this.state} />)*/}
} {/*}*/}
></Route> {/*></Route>*/}
<Route path="/crowdsourcing/new" {/*<Route path="/crowdsourcing/new"*/}
render={ {/*render={*/}
(props) => (<PackageIndexNewandEdit {...this.props} {...props} {...this.state} />) {/*(props) => (<PackageIndexNewandEdit {...this.props} {...props} {...this.state} />)*/}
} {/*}*/}
></Route> {/*></Route>*/}
<Route path="/crowdsourcing/:id" {/*<Route path="/crowdsourcing/:id"*/}
render={ {/*render={*/}
(props) => (<PackageIndexNEITaskDetails {...this.props} {...props} {...this.state} />) {/*(props) => (<PackageIndexNEITaskDetails {...this.props} {...props} {...this.state} />)*/}
} {/*}*/}
></Route> {/*></Route>*/}
<Route path="/crowdsourcing" {/*<Route path="/crowdsourcing"*/}
render={ {/*render={*/}
(props) => (<PackageIndex {...this.props} {...props} {...this.state} />) {/*(props) => (<PackageIndex {...this.props} {...props} {...this.state} />)*/}
} {/*}*/}
></Route> {/*></Route>*/}
</Switch> </Switch>
</div> </div>

@ -815,7 +815,7 @@ submittojoinclass=(value)=>{
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/shixuns`}>我的实训</Link></li> <li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/shixuns`}>我的实训</Link></li>
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/paths`}>我的实践课程</Link></li> <li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/paths`}>我的实践课程</Link></li>
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/projects`}>我的项目</Link></li> <li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/projects`}>我的项目</Link></li>
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/package`}>我的众包</Link></li> {/*<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/package`}>我的众包</Link></li>*/}
<li><a href={`/account/profile`}>账号管理</a></li> <li><a href={`/account/profile`}>账号管理</a></li>
{/*<li><a onClick={()=>this.educoderlogin()} >登入测试接口</a></li>*/} {/*<li><a onClick={()=>this.educoderlogin()} >登入测试接口</a></li>*/}
{/*<li><a onClick={()=>this.trialapplications()} >试用申请</a> </li>*/} {/*<li><a onClick={()=>this.trialapplications()} >试用申请</a> </li>*/}

@ -951,8 +951,8 @@ export default class TPMevaluation extends Component {
<Option value={2}>apk/exe</Option> <Option value={2}>apk/exe</Option>
<Option value={3}>txt</Option> <Option value={3}>txt</Option>
<Option value={4}>html</Option> <Option value={4}>html</Option>
<Option value={5}>mp3</Option> {/*<Option value={5}>mp3</Option>*/}
<Option value={6}>mp4</Option> {/*<Option value={6}>mp4</Option>*/}
</Select> </Select>
<a className="ml10" onClick={()=>this.showrepositoryurltip(1)}><img src={getImageUrl("images/educoder/problem.png")}/></a> <a className="ml10" onClick={()=>this.showrepositoryurltip(1)}><img src={getImageUrl("images/educoder/problem.png")}/></a>
<div className="invite-tip clearfix repository_url_tippostion" style={{display:showrepositoryurltiptype===true?"block":"none"}} id="repository_url_tip" <div className="invite-tip clearfix repository_url_tippostion" style={{display:showrepositoryurltiptype===true?"block":"none"}} id="repository_url_tip"

@ -384,11 +384,11 @@ class Infos extends Component{
to={`/users/${username}/projects`}>项目</Link> to={`/users/${username}/projects`}>项目</Link>
</li> </li>
<li className={`${moduleName == 'package' ? 'active' : '' }`}> {/*<li className={`${moduleName == 'package' ? 'active' : '' }`}>*/}
<Link {/*<Link*/}
onClick={() => this.setState({moduleName: 'package'})} {/*onClick={() => this.setState({moduleName: 'package'})}*/}
to={`/users/${username}/package`}>众包</Link> {/*to={`/users/${username}/package`}>众包</Link>*/}
</li> {/*</li>*/}
{/*{ data && data.identity!="学生" && <li> <a href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}?type=m_bank`}>题库</a></li>}*/} {/*{ data && data.identity!="学生" && <li> <a href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}?type=m_bank`}>题库</a></li>}*/}
@ -404,11 +404,11 @@ class Infos extends Component{
{/* 众包 */} {/* 众包 */}
{/* http://localhost:3007/courses/1309/homework/9300/setting */} {/* http://localhost:3007/courses/1309/homework/9300/setting */}
<Route exact path="/users/:username/package" {/*<Route exact path="/users/:username/package"*/}
render={ {/*render={*/}
(props) => (<InfosPackage {...this.props} {...props} {...this.state} />) {/*(props) => (<InfosPackage {...this.props} {...props} {...this.state} />)*/}
} {/*}*/}
></Route> {/*></Route>*/}
{/* 课堂 */} {/* 课堂 */}
{/* http://localhost:3007/courses/1309/homework/9300/setting */} {/* http://localhost:3007/courses/1309/homework/9300/setting */}

Loading…
Cancel
Save