diff --git a/public/react/src/modules/courses/Video/Video.js b/public/react/src/modules/courses/Video/Video.js index cc4564897..2e5cc23dc 100644 --- a/public/react/src/modules/courses/Video/Video.js +++ b/public/react/src/modules/courses/Video/Video.js @@ -258,7 +258,7 @@ class Video extends Component { //console.log(course_identity > 2 && item.user_id === user_id) return ( this.props.Setmyktid(id)} + Setmyktid={(id,title)=>this.props.Setmyktid(id,title)} mykt={this.props.mykt} {...this.props} {...this.state} diff --git a/public/react/src/modules/courses/Video/VideoIndex.js b/public/react/src/modules/courses/Video/VideoIndex.js index ef0b93ead..f5a3ae95b 100644 --- a/public/react/src/modules/courses/Video/VideoIndex.js +++ b/public/react/src/modules/courses/Video/VideoIndex.js @@ -42,6 +42,7 @@ class VideoIndex extends Component { liveVisible: false, statistics: false, myktid:null, + mytitle:'' } } @@ -56,10 +57,23 @@ class VideoIndex extends Component { this.getLiveList(page); } } - Setmyktid=(id)=>{ - this.setState({ - myktid:id - }) + Setmyktid=(id,title)=>{ + const isAdmin = this.props&& this.props.isAdmin(); + if(isAdmin===true){ + this.setState({ + myktid:id, + statistics:true, + mytitle:title, + }) + }else{ + this.setState({ + statistics:true, + myktid:null, + mytitle:"", + + }) + } + } componentDidMount = () => { const {search} = this.props.location; @@ -84,6 +98,8 @@ class VideoIndex extends Component { if(this.props.homedirectory ===true){ this.setState({ statistics:false, + myktid:null, + mytitle:"", }) } } @@ -260,12 +276,14 @@ class VideoIndex extends Component { this.setState({ statistics: bool, + myktid:null, + mytitle:"", }) } render() { - const {videos, upload, videoData, type, liveData, lives, page, liveVisible, isSpining, liveId, otherLinkVisible, statistics} = this.state; + const {videos, upload, videoData, type, liveData, lives, page, liveVisible, isSpining, liveId, otherLinkVisible, statistics,myktid} = this.state; const {coursesId, videoId} = this.props.match.params; let {course_identity} = this.props && this.props.coursedata; let is_teacher = this.props && this.props.user && this.props.user.is_teacher; @@ -382,8 +400,16 @@ class VideoIndex extends Component { : + ( + myktid===null||myktid===undefined? + this.statisticsy(b)}> + : + + this.tisticsbools(b,id,t)}> + + ) + - this.statisticsy(b)}> } @@ -394,7 +420,7 @@ class VideoIndex extends Component { type === "video" ? this.Setmyktid(id)} + Setmyktid={(id,title)=>this.Setmyktid(id,title)} upload={upload} videos={videos} page={page}