|
|
@ -1,7 +1,7 @@
|
|
|
|
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 } from 'educoder'
|
|
|
|
import { getUrl, WordsBtn } from 'educoder'
|
|
|
|
class BoardsListItem extends Component{
|
|
|
|
class BoardsListItem extends Component{
|
|
|
|
constructor(props){
|
|
|
|
constructor(props){
|
|
|
|
super(props);
|
|
|
|
super(props);
|
|
|
@ -61,34 +61,37 @@ class BoardsListItem extends Component{
|
|
|
|
</h6>
|
|
|
|
</h6>
|
|
|
|
|
|
|
|
|
|
|
|
<div className="cl"></div>
|
|
|
|
<div className="cl"></div>
|
|
|
|
<p className="color-grey panel-lightgrey mt10 fl">
|
|
|
|
<p className="color-grey panel-lightgrey mt18 fl">
|
|
|
|
<span className="mr50">
|
|
|
|
<span className="mr50">
|
|
|
|
<a href={`/users/${discussMessage.author.login}`} className="panel-name-small hide fl mr15 mr30 color-grey3">{discussMessage.author.name}</a>
|
|
|
|
<a href={`/users/${discussMessage.author.login}`} className="panel-name-small hide fl mr15 mr30 color-grey3 font-14">{discussMessage.author.name}</a>
|
|
|
|
|
|
|
|
|
|
|
|
{ discussMessage.total_replies_count != 0 && <span className="mr15 color-grey9">{discussMessage.total_replies_count} 回复</span> }
|
|
|
|
{ discussMessage.total_replies_count != 0 && <span className="mr15 color-grey9 font-14">{discussMessage.total_replies_count} 回复</span> }
|
|
|
|
{ discussMessage.total_praises_count != 0 && <span className="mr15 color-grey9">{discussMessage.total_praises_count} 点赞</span> }
|
|
|
|
{ discussMessage.total_praises_count != 0 && <span className="mr15 color-grey9 font-14">{discussMessage.total_praises_count} 点赞</span> }
|
|
|
|
{ discussMessage.visits != 0 && <span className="mr15 color-grey9">{discussMessage.visits} 浏览</span> }
|
|
|
|
{ discussMessage.visits != 0 && <span className="mr15 color-grey9 font-14">{discussMessage.visits} 浏览</span> }
|
|
|
|
|
|
|
|
|
|
|
|
<span className="mr15 color-light-grey-C">{moment(discussMessage.created_on).fromNow()} </span>
|
|
|
|
<span className="mr15 color-light-grey-C font-14">{moment(discussMessage.created_on).fromNow()} </span>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
{/* <span className="mr10">最后回复<span className="ml10 mr10">社区导师</span>10个月前</span> */}
|
|
|
|
|
|
|
|
</p>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<div className="fr mt15">
|
|
|
|
|
|
|
|
{(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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/* <span className="mr10"><i className="fa fa-eye color-grey mr5 "></i>473</span> */}
|
|
|
|
|
|
|
|
{/* <p className="fr panel-lightgrey mt10">
|
|
|
|
|
|
|
|
<span className="mr10"><i className="fa fa-eye color-grey mr5" data-tip-down="浏览数"></i>82</span>
|
|
|
|
|
|
|
|
<span className="mr10"><i className="fa fa-thumbs-up color-grey mr5" data-tip-down="点赞数"></i>1</span>
|
|
|
|
|
|
|
|
<span className="mr10"><i className="fa fa-comments-o color-grey mr5" data-tip-down="回复数"></i>4</span>
|
|
|
|
|
|
|
|
</p> */}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ (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>
|
|
|
|
<li className="edu-position edu-position-hidebox">
|
|
|
|
<li className="edu-position edu-position-hidebox">
|
|
|
|
<i className="fa fa-bars color-grey-b"></i>
|
|
|
|
<i className="fa fa-bars color-grey-b"></i>
|
|
|
|
<ul className="edu-position-hide undis">
|
|
|
|
<ul className="edu-position-hide undis">
|
|
|
|
{/* <li><a href="javascript:void(0)" onclick="show_send(34255, 1, 'message');">发送</a></li> */}
|
|
|
|
|
|
|
|
{(isAdmin || discussMessage.author.login == current_user.login) && <li><a href="javascript:void(0)" onClick={(e) => {
|
|
|
|
{(isAdmin || discussMessage.author.login == current_user.login) && <li><a href="javascript:void(0)" onClick={(e) => {
|
|
|
|
this.props.toEditPage(this.props.match.params.coursesId, this.props.match.params.boardId, discussMessage.id )} } >编辑</a></li>
|
|
|
|
this.props.toEditPage(this.props.match.params.coursesId, this.props.match.params.boardId, discussMessage.id )} } >编辑</a></li>
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -96,14 +99,13 @@ class BoardsListItem extends Component{
|
|
|
|
{ discussMessage.sticky ? '取消置顶' : '置顶' }
|
|
|
|
{ discussMessage.sticky ? '取消置顶' : '置顶' }
|
|
|
|
</a></li>
|
|
|
|
</a></li>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{/* <li>
|
|
|
|
|
|
|
|
<a href="javascript:void(0);" onclick="delete_confirm_box_3('/boards/5464/topics/34255/destroy', '确定要删除该帖子吗?')">删除</a>
|
|
|
|
|
|
|
|
</li> */}
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
} */}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
)
|
|
|
|