dev_forum
hjm 6 years ago
parent 716c2b68ca
commit 6995de1523

@ -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>
) )

@ -156,7 +156,7 @@ class CommonWorkItem extends Component{
<span className="fl"> <span className="fl">
<CoursesListType typelist={item.status} /> <CoursesListType typelist={item.status} />
</span> </span>
{ {/* {
mainList && isAdmin && mainList && isAdmin &&
<li className="fr drop_down"> <li className="fr drop_down">
<i className="iconfont icon-caidan font-16 color-grey-c"></i> <i className="iconfont icon-caidan font-16 color-grey-c"></i>
@ -170,7 +170,7 @@ class CommonWorkItem extends Component{
</li> </li>
</ul> </ul>
</li> </li>
} } */}
</p> </p>
<p className="color-grey-9 clearfix"> <p className="color-grey-9 clearfix">
{item.commit_count===undefined?"":<span className="mr20 fl">{item.commit_count} 已交</span>} {item.commit_count===undefined?"":<span className="mr20 fl">{item.commit_count} 已交</span>}
@ -184,6 +184,12 @@ class CommonWorkItem extends Component{
<span className="mr20 fl">{item.status_time}</span> <span className="mr20 fl">{item.status_time}</span>
</Tooltip> </Tooltip>
} }
{this.props.isAdmin && <div className="fr">
<WordsBtn style="blue" className="fl font-16 ml28" onClick={ () => { this.props.toEditPage(this.props.match.params, item.homework_id) }}>编辑</WordsBtn>
<WordsBtn style="blue" className="fl font-16 ml28" onClick={ () => { this.props.toWorkSettingPage(this.props.match.params, item.homework_id) }}>设置</WordsBtn>
</div>}
{ {
// //
isStudent && isStudent &&

Loading…
Cancel
Save