dev_home
杨树明 6 years ago
parent 29c22fdf35
commit 62594b13e4

@ -118,21 +118,24 @@ class ShixunsHome extends Component {
let shixuntype=false; let shixuntype=false;
let pathstype=false; let pathstype=false;
if(this.props&&this.props.mygetHelmetapi!=null){ if(this.props&&this.props.mygetHelmetapi!=null){
console.log(this.props.mygetHelmetapi.navbar)
let shixun="/shixuns"; let shixun="/shixuns";
let paths="/paths"; let paths="/paths";
this.props.mygetHelmetapi.navbar.map((item,key)=>{ this.props.mygetHelmetapi.navbar.map((item,key)=>{
var reg = RegExp(item.link); var reg = RegExp(item.link);
if(shixun.match(reg)){ if(shixun.match(reg)){
shixuntype=true if(item.hidden===true){
shixuntype=true
}
} }
if(paths.match(reg)){ if(paths.match(reg)){
pathstype=true if(item.hidden===true){
pathstype=true
}
} }
}) })
}
}
return ( return (
<div className="newMain clearfix backFAFAFA shixunsHome"> <div className="newMain clearfix backFAFAFA shixunsHome">
{this.state.updata===undefined?"":<UpgradeModals {this.state.updata===undefined?"":<UpgradeModals
@ -232,7 +235,7 @@ class ShixunsHome extends Component {
</div> </div>
{/*实训路径*/} {/*实训路径*/}
{pathstype===true?<div className="clearfix pt20 educontent pr pb20"> {pathstype===true?"":<div className="clearfix pt20 educontent pr pb20">
<div className="edu-txt-center"> <div className="edu-txt-center">
<p className="color-dark edu-txt-center font-24" style={{lineHeight: '30px'}}>实践课程</p> <p className="color-dark edu-txt-center font-24" style={{lineHeight: '30px'}}>实践课程</p>
<p className="color-grey-cd font-12">TRAINING COURSE</p> <p className="color-grey-cd font-12">TRAINING COURSE</p>
@ -308,10 +311,10 @@ class ShixunsHome extends Component {
} }
</div> </div>
</div>:""} </div>}
{/*精选实训 改为 开发社区*/} {/*精选实训 改为 开发社区*/}
{shixuntype===true?<div className="clearfix pt20 educontent pr pb20"> {shixuntype===true?"":<div className="clearfix pt20 educontent pr pb20">
<div className="edu-txt-center"> <div className="edu-txt-center">
<p className="color-dark edu-txt-center font-24" style={{lineHeight: '30px'}}>实训项目</p> <p className="color-dark edu-txt-center font-24" style={{lineHeight: '30px'}}>实训项目</p>
<p className="color-grey-cd font-12">DEVELOPMENT COMMUNITY</p> <p className="color-grey-cd font-12">DEVELOPMENT COMMUNITY</p>
@ -403,7 +406,7 @@ class ShixunsHome extends Component {
</div> </div>
</div>:""} </div>}

@ -875,8 +875,26 @@ submittojoinclass=(value)=>{
// console.log("NewHeadergetHelmetapi432423423423"); // console.log("NewHeadergetHelmetapi432423423423");
// console.log(mygetHelmetapi2); // console.log(mygetHelmetapi2);
// console.log("NewHeadermygetHelmetapi123123123123"); // console.log("NewHeadermygetHelmetapi123123123123");
// console.log(mygetHelmetapi2);
let shixuntype=false;
let pathstype=false;
if(this.props&&this.props.mygetHelmetapi!=null){
let shixun="/shixuns";
let paths="/paths";
this.props.mygetHelmetapi.navbar.map((item,key)=>{
var reg = RegExp(item.link);
if(shixun.match(reg)){
if(item.hidden===true){
shixuntype=true
}
}
if(paths.match(reg)){
if(item.hidden===true){
pathstype=true
}
}
})
}
return ( return (
<div className="newHeaders" id="nHeader" > <div className="newHeaders" id="nHeader" >
@ -1261,9 +1279,9 @@ submittojoinclass=(value)=>{
<div className="overPart"></div> <div className="overPart"></div>
<ul className="fl with50 edu-txt-center pr ul-leftline"> <ul className="fl with50 edu-txt-center pr ul-leftline">
{this.props.current_user&&this.props.current_user.user_identity==="学生"?"":<li><a onClick={(url)=>this.getUser("/courses/new")}>新建翻转课堂</a></li>} {this.props.current_user&&this.props.current_user.user_identity==="学生"?"":<li><a onClick={(url)=>this.getUser("/courses/new")}>新建翻转课堂</a></li>}
<li><a onClick={(url)=>this.getUser("/shixuns/new")}>新建实训项目</a></li> {shixuntype===true?"":<li><a onClick={(url)=>this.getUser("/shixuns/new")}>新建实训项目</a></li>}
{this.props.Headertop===undefined?"": {this.props.Headertop===undefined?"":
<li><a onClick={(url)=>this.getUser("/paths/new")} >新建实践课程</a></li> pathstype===true?"":<li><a onClick={(url)=>this.getUser("/paths/new")} >新建实践课程</a></li>
} }
<li><a onClick={(url)=>this.getUser("/projects/new","projects")} target="_blank">新建开发项目</a></li> <li><a onClick={(url)=>this.getUser("/projects/new","projects")} target="_blank">新建开发项目</a></li>
</ul> </ul>

@ -34,6 +34,25 @@ class InfosBanner extends Component{
// console.log(is_current) // console.log(is_current)
// console.log(current_user) // console.log(current_user)
// console.log(current_user.is_teacher) // console.log(current_user.is_teacher)
let shixuntype=false;
let pathstype=false;
if(this.props&&this.props.mygetHelmetapi!=null){
let shixun="/shixuns";
let paths="/paths";
this.props.mygetHelmetapi.navbar.map((item,key)=>{
var reg = RegExp(item.link);
if(shixun.match(reg)){
if(item.hidden===true){
shixuntype=true
}
}
if(paths.match(reg)){
if(item.hidden===true){
pathstype=true
}
}
})
}
return( return(
<div className="bannerPanel mb60"> <div className="bannerPanel mb60">
@ -96,16 +115,16 @@ class InfosBanner extends Component{
onClick={() => this.setState({moduleName: 'courses'})} onClick={() => this.setState({moduleName: 'courses'})}
to={`/users/${username}/courses`}>翻转课堂</Link> to={`/users/${username}/courses`}>翻转课堂</Link>
</li> </li>
<li className={`${moduleName == 'shixuns' ? 'active' : '' }`}> {shixuntype===true?"":<li className={`${moduleName == 'shixuns' ? 'active' : '' }`}>
<Link <Link
onClick={() => this.setState({moduleName: 'shixuns'})} onClick={() => this.setState({moduleName: 'shixuns'})}
to={`/users/${username}/shixuns`}>实训项目</Link> to={`/users/${username}/shixuns`}>实训项目</Link>
</li> </li>}
<li className={`${moduleName == 'paths' ? 'active' : '' }`}> {pathstype===true?"":<li className={`${moduleName == 'paths' ? 'active' : '' }`}>
<Link <Link
onClick={() => this.setState({moduleName: 'paths'})} onClick={() => this.setState({moduleName: 'paths'})}
to={`/users/${username}/paths`}>实践课程</Link> to={`/users/${username}/paths`}>实践课程</Link>
</li> </li>}
<li className={`${moduleName == 'projects' ? 'active' : '' }`}> <li className={`${moduleName == 'projects' ? 'active' : '' }`}>
<Link <Link
onClick={() => this.setState({moduleName: 'projects'})} onClick={() => this.setState({moduleName: 'projects'})}

Loading…
Cancel
Save