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

dev_home
cxt 5 years ago
commit d09e141ab0

@ -1,7 +1,8 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import {Tooltip} from 'antd' import {Tooltip} from 'antd'
import moment from 'moment' import moment from 'moment'
import { getUrl, WordsBtn } from 'educoder' import { getUrl, WordsBtn, ConditionToolTip } from 'educoder'
import './boardsListItem.css';
class BoardsListItem extends Component{ class BoardsListItem extends Component{
constructor(props){ constructor(props){
super(props); super(props);
@ -75,6 +76,16 @@ class BoardsListItem extends Component{
</Tooltip>) : "" </Tooltip>) : ""
} }
</h6> </h6>
<div className="fr">
{(isAdmin || discussMessage.author.login == current_user.login) &&
<WordsBtn style="blue" className="fl font-16 ml28"
onClick={(e) => { this.props.toEditPage(this.props.match.params.coursesId, this.props.match.params.boardId, discussMessage.id )} }>编辑</WordsBtn> }
{ isAdmin && <WordsBtn style="blue" className="fl font-16 ml28"
onClick={(e) => { debugger; onSticky(discussMessage); e.cancelBubble = true; e.stopPropagation();}}>
{ discussMessage.sticky ? '取消置顶' : '置顶' }</WordsBtn> }
</div>
<div className="cl"></div> <div className="cl"></div>
<p className="color-grey panel-lightgrey mt18 fl"> <p className="color-grey panel-lightgrey mt18 fl">
@ -88,20 +99,20 @@ class BoardsListItem extends Component{
<span className="mr15 color-light-grey-C font-14">{moment(discussMessage.created_on).fromNow()} </span> <span className="mr15 color-light-grey-C font-14">{moment(discussMessage.created_on).fromNow()} </span>
</span> </span>
</p> </p>
<div className="fr mt15"> {
{(isAdmin || discussMessage.author.login == current_user.login) && discussMessage.category_name &&
<WordsBtn style="blue" className="fl font-16 ml28" <div className={'directory_style'}>
onClick={(e) => { this.props.toEditPage(this.props.match.params.coursesId, this.props.match.params.boardId, discussMessage.id )} }>编辑</WordsBtn> } <ConditionToolTip title={discussMessage.category_name} condition={discussMessage.category_name}>
{ <div className=" color-grey9 task-hide fr"
{ isAdmin && <WordsBtn style="blue" className="fl font-16 ml28" style={{"maxWidth":"216px"}}
onClick={(e) => { debugger; onSticky(discussMessage); e.cancelBubble = true; e.stopPropagation();}}> title={discussMessage.category_name}>
{ discussMessage.sticky ? '取消置顶' : '置顶' }</WordsBtn> } 所属目录{discussMessage.category_name}
</div> </div>
}
</ConditionToolTip>
</div>
}
{/* { (isAdmin || discussMessage.author.login == current_user.login) && {/* { (isAdmin || discussMessage.author.login == current_user.login) &&
<div className="homepagePostSetting" style={{"right":"4px","top":"5px","display":"block"}}> <div className="homepagePostSetting" style={{"right":"4px","top":"5px","display":"block"}}>
<ul> <ul>

@ -0,0 +1,9 @@
.directory_style {
position: absolute;
right: 0;
bottom: 0;
maxSize: 20px;
overflow: hidden;
whiteSpace: nowrap;
textOverflow: ellipsis
}

@ -386,8 +386,8 @@ class Boards extends Component{
{ {
boards && boards.filter((item)=> { boards && boards.filter((item)=> {
return item.id != bid && (!this.state.dirSearchValue || item.name.indexOf(this.state.dirSearchValue) != -1) return item.id != bid && (!this.state.dirSearchValue || item.name.indexOf(this.state.dirSearchValue) != -1)
}).map( (item) => { }).map( (item, index) => {
return <li onClick={() => this.moveTo(item)} title={item.name}>{item.name}</li> return <li key={`i_${index}`} onClick={() => this.moveTo(item)} title={item.name}>{item.name}</li>
}) })
} }
{ isAdmin && !isCourseEnd && { isAdmin && !isCourseEnd &&
@ -427,7 +427,7 @@ class Boards extends Component{
<Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}> <Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}>
{ messages.map((item, index) => { { messages.map((item, index) => {
return ( return (
<div className="mt20 edu-back-white padding02010"> <div className="mt20 edu-back-white padding02010" key={`d_${index}`}>
<BoardsListItem <BoardsListItem
{...this.props} {...this.props}
discussMessage={item} discussMessage={item}

Loading…
Cancel
Save