dev_home
杨树明 5 years ago
parent fdc04c1d62
commit 0b47c7c038

@ -878,9 +878,11 @@ submittojoinclass=(value)=>{
let shixuntype=false; let shixuntype=false;
let pathstype=false; let pathstype=false;
let coursestypes=false;
if(this.props&&this.props.mygetHelmetapi!=null){ if(this.props&&this.props.mygetHelmetapi!=null){
let shixun="/shixuns"; let shixun="/shixuns";
let paths="/paths"; let paths="/paths";
let courses="/courses";
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)){
@ -893,6 +895,11 @@ submittojoinclass=(value)=>{
pathstype=true pathstype=true
} }
} }
if(courses.match(reg)){
if(item.hidden===true){
coursestypes=true
}
}
}) })
} }
return ( return (
@ -1278,7 +1285,7 @@ submittojoinclass=(value)=>{
<div className="edu-menu-list" style={{top: '60px',width:"240px"}}> <div className="edu-menu-list" style={{top: '60px',width:"240px"}}>
<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==="学生"?"":coursestypes===true?"":<li><a onClick={(url)=>this.getUser("/courses/new")}>新建翻转课堂</a></li>}
{shixuntype===true?"":<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?"":
pathstype===true?"":<li><a onClick={(url)=>this.getUser("/paths/new")} >新建实践课程</a></li> pathstype===true?"":<li><a onClick={(url)=>this.getUser("/paths/new")} >新建实践课程</a></li>
@ -1287,9 +1294,9 @@ submittojoinclass=(value)=>{
</ul> </ul>
<ul className="fl with50 edu-txt-center"> <ul className="fl with50 edu-txt-center">
<li> {coursestypes===true?"":<li>
<a onClick={this.tojoinclass}>加入翻转课堂</a> <a onClick={this.tojoinclass}>加入翻转课堂</a>
</li> </li>}
{Addcoursestypes===true?<Addcourses {Addcoursestypes===true?<Addcourses
Addcoursestype={Addcoursestypes} Addcoursestype={Addcoursestypes}

@ -36,9 +36,11 @@ class InfosBanner extends Component{
// console.log(current_user.is_teacher) // console.log(current_user.is_teacher)
let shixuntype=false; let shixuntype=false;
let pathstype=false; let pathstype=false;
let coursestypes=false;
if(this.props&&this.props.mygetHelmetapi!=null){ if(this.props&&this.props.mygetHelmetapi!=null){
let shixun="/shixuns"; let shixun="/shixuns";
let paths="/paths"; let paths="/paths";
let courses="/courses";
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)){
@ -51,6 +53,11 @@ class InfosBanner extends Component{
pathstype=true pathstype=true
} }
} }
if(courses.match(reg)){
if(item.hidden===true){
coursestypes=true
}
}
}) })
} }
@ -110,11 +117,11 @@ class InfosBanner extends Component{
</div> </div>
</div> </div>
<div className="userNav"> <div className="userNav">
<li className={`${moduleName == 'courses' ||moduleName == undefined ? 'active' : '' }`}> {coursestypes===true?"":<li className={`${moduleName == 'courses' ||moduleName == undefined ? 'active' : '' }`}>
<Link <Link
onClick={() => this.setState({moduleName: 'courses'})} onClick={() => this.setState({moduleName: 'courses'})}
to={`/users/${username}/courses`}>翻转课堂</Link> to={`/users/${username}/courses`}>翻转课堂</Link>
</li> </li>}
{shixuntype===true?"":<li className={`${moduleName == 'shixuns' ? 'active' : '' }`}> {shixuntype===true?"":<li className={`${moduleName == 'shixuns' ? 'active' : '' }`}>
<Link <Link
onClick={() => this.setState({moduleName: 'shixuns'})} onClick={() => this.setState({moduleName: 'shixuns'})}

Loading…
Cancel
Save