|
|
|
@ -8,8 +8,7 @@ import DialogContentText from '@material-ui/core/DialogContentText';
|
|
|
|
|
import DialogTitle from '@material-ui/core/DialogTitle';
|
|
|
|
|
import Button from '@material-ui/core/Button';
|
|
|
|
|
|
|
|
|
|
import Tooltip from '@material-ui/core/Tooltip';
|
|
|
|
|
|
|
|
|
|
import { Tooltip } from 'antd'
|
|
|
|
|
import { getImageUrl } from 'educoder';
|
|
|
|
|
|
|
|
|
|
import CommentItemKEEditor from './CommentItemKEEditor';
|
|
|
|
@ -134,9 +133,6 @@ class Comments extends Component {
|
|
|
|
|
} else {
|
|
|
|
|
$(reply_message_el).show();
|
|
|
|
|
}
|
|
|
|
|
// $(reply_message_el).html("");
|
|
|
|
|
|
|
|
|
|
// $(reply_iconup_el).hide();
|
|
|
|
|
}
|
|
|
|
|
} else { // MD
|
|
|
|
|
this.setState({
|
|
|
|
@ -144,11 +140,6 @@ class Comments extends Component {
|
|
|
|
|
showReplyEditorFlag: !this.state.showReplyEditorFlag
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// enableReplyTo
|
|
|
|
|
// onClick={() => this.replyTo(item.user_id)}
|
|
|
|
|
replyTo = (toUserId) => {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
renderChildenComments(comment) {
|
|
|
|
|
if (!comment.children || comment.children.length === 0) {
|
|
|
|
@ -209,29 +200,9 @@ class Comments extends Component {
|
|
|
|
|
</a>
|
|
|
|
|
: ''}
|
|
|
|
|
|
|
|
|
|
{/*
|
|
|
|
|
<span className="ml5 mr5 color-grey-8">|</span>
|
|
|
|
|
|
|
|
|
|
<span className="reply_praise_count_952">
|
|
|
|
|
<a href="/praise_tread/praise_plus?obj_id=952&obj_type=Discuss&type=reply&user_activity_id=952" data-remote="true" className="fr mr5 color-grey-8" data-tip-down="点赞">
|
|
|
|
|
<i className="fa fa-thumbs-up mr5"></i>赞
|
|
|
|
|
|
|
|
|
|
<span className="ml5 fr"></span>
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
</span>*/}
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
{/* currentUser.id == item.creator_user.id && (
|
|
|
|
|
<p className="fr mr10 orig_repll">
|
|
|
|
|
<span id={`hidden_discuss_btn_${item.id}`}>
|
|
|
|
|
<a href="javascript:void(0);" className="color-grey-8" onClick={ this.onCommentBtnClick(comment, item, 'delete') } >
|
|
|
|
|
<i className="far fa-trash-alt mr5"></i>删除
|
|
|
|
|
</a>
|
|
|
|
|
<span className="ml5 mr5 color-grey-8">|</span>
|
|
|
|
|
</span>
|
|
|
|
|
</p>
|
|
|
|
|
)*/}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="comment_content clearfix" id={`reply_content_${item.id}`}>
|
|
|
|
@ -320,28 +291,11 @@ class Comments extends Component {
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* currentUser.id == item.creator_user.id && (
|
|
|
|
|
<p className="fr mr10 orig_repll">
|
|
|
|
|
<span id={`hidden_discuss_btn_${item.id}`}>
|
|
|
|
|
<a href="javascript:void(0);" className="color-grey-8" onClick={ deleteComment.bind(this, item, index) } >
|
|
|
|
|
<i className="far fa-trash-alt mr5"></i>删除
|
|
|
|
|
</a>
|
|
|
|
|
<span className="ml5 mr5 color-grey-8">|</span>
|
|
|
|
|
</span>
|
|
|
|
|
</p>
|
|
|
|
|
)*/}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="comment_content clearfix" id={`reply_content_${item.id}`}>
|
|
|
|
|
<div className="color-grey-3" id={`reply_content_${item.id}`}>
|
|
|
|
|
{/* 改成后端返回了的,都是要显示的,不管hidden的值是true还是false */}
|
|
|
|
|
|
|
|
|
|
{/* { item.hidden && ((this.props.onlySuperAdminCouldHide && !item.isSuperAdmin)
|
|
|
|
|
|| !this.props.onlySuperAdminCouldHide && item.admin === false && (item.manager === false || item.manager == undefined))
|
|
|
|
|
? <p className="color-orange font-16">违规评论已被屏蔽!</p>
|
|
|
|
|
: */}
|
|
|
|
|
<div className={"break_word_comments markdown-body"} dangerouslySetInnerHTML={{ __html: _content }}></div>
|
|
|
|
|
{/* } */}
|
|
|
|
|
<div className="cl"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -356,12 +310,10 @@ class Comments extends Component {
|
|
|
|
|
</Tooltip>
|
|
|
|
|
: ''}
|
|
|
|
|
</div>
|
|
|
|
|
{/*mr10 */}
|
|
|
|
|
<p className="fr orig_reply">
|
|
|
|
|
<span id="hidden_discuss_btn_952">
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
{/* && !item.reward */}
|
|
|
|
|
{this.props.showRewardButton != false && item.admin === true ?
|
|
|
|
|
<a href="javascript:void(0);" className="color-grey-8 fl mt2" onClick={() => this.showGoldRewardDialog(item)}>
|
|
|
|
|
<Tooltip title={"给TA奖励金币"} disableFocusListener={true}>
|
|
|
|
@ -425,7 +377,6 @@ class Comments extends Component {
|
|
|
|
|
>
|
|
|
|
|
</CommentItemMDEditor>
|
|
|
|
|
}
|
|
|
|
|
{/* <div id={`reply_message_${item.id}`} className="reply_to_message"></div> */}
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -433,15 +384,6 @@ class Comments extends Component {
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|
/*
|
|
|
|
|
/users/reply_to?reply_id=${item.id}&type=Challenge&user_activity_id=118
|
|
|
|
|
*/
|
|
|
|
|
/*
|
|
|
|
|
onclick="delete_confirm_box_2('<%= discuss_path(comment, :challenge_id => @game_challenge) %>', '确定要删除该条回复吗?')"
|
|
|
|
|
delete按钮
|
|
|
|
|
id=`delete_reply_<%=@game_challenge.id %>_<%=comment.id %>`
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
return commentsElement;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -504,8 +446,6 @@ class Comments extends Component {
|
|
|
|
|
const { deleteComment, onPaginationChange, comment_count_without_reply, currentPage, comments, usingAntdModal } = this.props;
|
|
|
|
|
const { dialogOpen, goldRewardDialogOpen, dialogType, goldRewardInputError } = this.state;
|
|
|
|
|
|
|
|
|
|
const goldRewardInputErrorObj = goldRewardInputError ? { 'error': 'error' } : {}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="fit -scroll" style={{ 'overflow-x': 'hidden' }}>
|
|
|
|
|
|
|
|
|
@ -560,13 +500,6 @@ class Comments extends Component {
|
|
|
|
|
<InputNumber placeholder="请输入奖励的金币数量" id="goldReward" type="number" value={this.state.goldRewardInput}
|
|
|
|
|
onChange={(e) => this.onGoldRewardInputChange(e)} width={228} style={{ width: '228px' }} />
|
|
|
|
|
|
|
|
|
|
{/* <FormControl { ...goldRewardInputErrorObj } aria-describedby="name-error-text">
|
|
|
|
|
<InputLabel htmlFor="goldReward">请输入奖励的金币数量</InputLabel>
|
|
|
|
|
<Input id="goldReward" type="number" value={this.state.goldRewardInput} onChange={(e) => this.onGoldRewardInputChange(e)} />
|
|
|
|
|
{ goldRewardInputError ? <FormHelperText id="name-error-text">奖励金币不能为空或负数</FormHelperText> : ''}
|
|
|
|
|
</FormControl> */}
|
|
|
|
|
|
|
|
|
|
{/*<DialogContentText id="alert-dialog-description" style={{textAlign: 'center'}}> </DialogContentText>*/}
|
|
|
|
|
</DialogContent>
|
|
|
|
|
<DialogActions>
|
|
|
|
|
<Button onClick={this.handleGoldRewardDialogClose} color="primary">
|
|
|
|
|