mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-30 02:56:20 -05:00
Merge pull request #2198 from paulkaplan/fix-comment-msg
Comment minor fixes
This commit is contained in:
commit
505dda09ae
5 changed files with 20 additions and 7 deletions
|
@ -238,6 +238,7 @@
|
||||||
"comments.status.delbyclass": "Deleted by class",
|
"comments.status.delbyclass": "Deleted by class",
|
||||||
"comments.status.hiddenduetourl": "Hidden due to URL",
|
"comments.status.hiddenduetourl": "Hidden due to URL",
|
||||||
"comments.status.markedbyfilter": "Marked by filter",
|
"comments.status.markedbyfilter": "Marked by filter",
|
||||||
|
"comments.status.censbyunconstructive": "Censored unconstructive",
|
||||||
"comments.status.suspended": "Suspended",
|
"comments.status.suspended": "Suspended",
|
||||||
"comments.status.acctdel": "Account deleted",
|
"comments.status.acctdel": "Account deleted",
|
||||||
"comments.status.deleted": "Deleted",
|
"comments.status.deleted": "Deleted",
|
||||||
|
|
|
@ -87,6 +87,7 @@ class Comment extends React.Component {
|
||||||
author,
|
author,
|
||||||
canDelete,
|
canDelete,
|
||||||
canReply,
|
canReply,
|
||||||
|
canReport,
|
||||||
canRestore,
|
canRestore,
|
||||||
content,
|
content,
|
||||||
datetimeCreated,
|
datetimeCreated,
|
||||||
|
@ -122,12 +123,14 @@ class Comment extends React.Component {
|
||||||
<FormattedMessage id="comments.delete" />
|
<FormattedMessage id="comments.delete" />
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
<span
|
{canReport && (
|
||||||
className="comment-report"
|
<span
|
||||||
onClick={this.handleReport}
|
className="comment-report"
|
||||||
>
|
onClick={this.handleReport}
|
||||||
<FormattedMessage id="comments.report" />
|
>
|
||||||
</span>
|
<FormattedMessage id="comments.report" />
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
) : (
|
) : (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
|
@ -215,6 +218,7 @@ Comment.propTypes = {
|
||||||
}),
|
}),
|
||||||
canDelete: PropTypes.bool,
|
canDelete: PropTypes.bool,
|
||||||
canReply: PropTypes.bool,
|
canReply: PropTypes.bool,
|
||||||
|
canReport: PropTypes.bool,
|
||||||
canRestore: PropTypes.bool,
|
canRestore: PropTypes.bool,
|
||||||
content: PropTypes.string,
|
content: PropTypes.string,
|
||||||
datetimeCreated: PropTypes.string,
|
datetimeCreated: PropTypes.string,
|
||||||
|
|
|
@ -55,6 +55,7 @@ class TopLevelComment extends React.Component {
|
||||||
author,
|
author,
|
||||||
canDelete,
|
canDelete,
|
||||||
canReply,
|
canReply,
|
||||||
|
canReport,
|
||||||
canRestore,
|
canRestore,
|
||||||
content,
|
content,
|
||||||
datetimeCreated,
|
datetimeCreated,
|
||||||
|
@ -80,6 +81,7 @@ class TopLevelComment extends React.Component {
|
||||||
datetimeCreated,
|
datetimeCreated,
|
||||||
canDelete,
|
canDelete,
|
||||||
canReply,
|
canReply,
|
||||||
|
canReport,
|
||||||
canRestore,
|
canRestore,
|
||||||
id,
|
id,
|
||||||
onDelete,
|
onDelete,
|
||||||
|
@ -102,6 +104,7 @@ class TopLevelComment extends React.Component {
|
||||||
author={reply.author}
|
author={reply.author}
|
||||||
canDelete={canDelete}
|
canDelete={canDelete}
|
||||||
canReply={canReply}
|
canReply={canReply}
|
||||||
|
canReport={canReport}
|
||||||
canRestore={canRestore && parentVisible}
|
canRestore={canRestore && parentVisible}
|
||||||
content={reply.content}
|
content={reply.content}
|
||||||
datetimeCreated={reply.datetime_created}
|
datetimeCreated={reply.datetime_created}
|
||||||
|
@ -143,6 +146,7 @@ TopLevelComment.propTypes = {
|
||||||
}),
|
}),
|
||||||
canDelete: PropTypes.bool,
|
canDelete: PropTypes.bool,
|
||||||
canReply: PropTypes.bool,
|
canReply: PropTypes.bool,
|
||||||
|
canReport: PropTypes.bool,
|
||||||
canRestore: PropTypes.bool,
|
canRestore: PropTypes.bool,
|
||||||
content: PropTypes.string,
|
content: PropTypes.string,
|
||||||
datetimeCreated: PropTypes.string,
|
datetimeCreated: PropTypes.string,
|
||||||
|
|
|
@ -45,6 +45,7 @@ const PreviewPresentation = ({
|
||||||
assetHost,
|
assetHost,
|
||||||
backpackOptions,
|
backpackOptions,
|
||||||
canAddToStudio,
|
canAddToStudio,
|
||||||
|
canDeleteComments,
|
||||||
canReport,
|
canReport,
|
||||||
canRestoreComments,
|
canRestoreComments,
|
||||||
comments,
|
comments,
|
||||||
|
@ -364,8 +365,9 @@ const PreviewPresentation = ({
|
||||||
{comments.map(comment => (
|
{comments.map(comment => (
|
||||||
<TopLevelComment
|
<TopLevelComment
|
||||||
author={comment.author}
|
author={comment.author}
|
||||||
canDelete={userOwnsProject}
|
canDelete={canDeleteComments}
|
||||||
canReply={isLoggedIn && projectInfo.comments_allowed}
|
canReply={isLoggedIn && projectInfo.comments_allowed}
|
||||||
|
canReport={isLoggedIn}
|
||||||
canRestore={canRestoreComments}
|
canRestore={canRestoreComments}
|
||||||
content={comment.content}
|
content={comment.content}
|
||||||
datetimeCreated={comment.datetime_created}
|
datetimeCreated={comment.datetime_created}
|
||||||
|
@ -412,6 +414,7 @@ PreviewPresentation.propTypes = {
|
||||||
visible: PropTypes.bool
|
visible: PropTypes.bool
|
||||||
}),
|
}),
|
||||||
canAddToStudio: PropTypes.bool,
|
canAddToStudio: PropTypes.bool,
|
||||||
|
canDeleteComments: PropTypes.bool,
|
||||||
canReport: PropTypes.bool,
|
canReport: PropTypes.bool,
|
||||||
canRestoreComments: PropTypes.bool,
|
canRestoreComments: PropTypes.bool,
|
||||||
comments: PropTypes.arrayOf(PropTypes.object),
|
comments: PropTypes.arrayOf(PropTypes.object),
|
||||||
|
|
|
@ -350,6 +350,7 @@ class Preview extends React.Component {
|
||||||
assetHost={this.props.assetHost}
|
assetHost={this.props.assetHost}
|
||||||
backpackOptions={this.props.backpackOptions}
|
backpackOptions={this.props.backpackOptions}
|
||||||
canAddToStudio={this.props.canAddToStudio}
|
canAddToStudio={this.props.canAddToStudio}
|
||||||
|
canDeleteComments={this.props.isAdmin || this.props.userOwnsProject}
|
||||||
canReport={this.props.canReport}
|
canReport={this.props.canReport}
|
||||||
canRestoreComments={this.props.isAdmin}
|
canRestoreComments={this.props.isAdmin}
|
||||||
comments={this.props.comments}
|
comments={this.props.comments}
|
||||||
|
|
Loading…
Reference in a new issue