diff --git a/app/javascript/mastodon/components/status.js b/app/javascript/mastodon/components/status.js index 40766da2e..a756c5190 100644 --- a/app/javascript/mastodon/components/status.js +++ b/app/javascript/mastodon/components/status.js @@ -200,11 +200,11 @@ class Status extends ImmutablePureComponent { handleExpandedToggle = () => { this.props.onToggleHidden(this._properStatus()); - } + }; handleCollapsedToggle = isCollapsed => { this.props.onToggleCollapsed(this._properStatus(), isCollapsed); - } + }; renderLoadingMediaGallery() { return (
0) { if (this.props.muted) { media = ( @@ -504,6 +506,9 @@ class Status extends ImmutablePureComponent { ); } + /** + * avatars + * */ if (otherAccounts && otherAccounts.size > 0) { statusAvatar = ( {isStaff && (
- - + + +
)} */} - {/* {status.get('in_reply_to_account_id') === status.getIn(['account', 'id']) &&*/} - {/*

oui je cause tout seul, c'est un thread

*/} - {/* }*/} - {/* {this.props.threadsCompile &&*/} - {/*

les threads sont en mode compilés

*/} - {/* }*/} + {/*{ isStaff && status.get('in_reply_to_account_id') === status.getIn(['account', 'id']) &&*/} + {/*

oui je cause tout seul, c'est un thread

*/} + {/*}*/} + {/*{this.props.threadsCompile &&*/} + {/*

les threads sont en mode compilés

*/} + {/*}*/} {/*
*/} { @@ -65,27 +65,28 @@ class StatusActionBar extends ImmutablePureComponent { }; static propTypes = { - status: ImmutablePropTypes.map.isRequired, - relationship: ImmutablePropTypes.map, - onReply: PropTypes.func, - onFavourite: PropTypes.func, - onReblog: PropTypes.func, - onDelete: PropTypes.func, - onDirect: PropTypes.func, - onMention: PropTypes.func, - onMute: PropTypes.func, - onUnmute: PropTypes.func, - onBlock: PropTypes.func, - onUnblock: PropTypes.func, - onBlockDomain: PropTypes.func, - onUnblockDomain: PropTypes.func, - onReport: PropTypes.func, - onEmbed: PropTypes.func, + status : ImmutablePropTypes.map.isRequired, + relationship : ImmutablePropTypes.map, + onReply : PropTypes.func, + onFavourite : PropTypes.func, + onReblog : PropTypes.func, + onDelete : PropTypes.func, + onDirect : PropTypes.func, + onMention : PropTypes.func, + onMute : PropTypes.func, + onUnmute : PropTypes.func, + onBlock : PropTypes.func, + onUnblock : PropTypes.func, + onBlockDomain : PropTypes.func, + onUnblockDomain : PropTypes.func, + onReport : PropTypes.func, + onEmbed : PropTypes.func, onMuteConversation: PropTypes.func, - onPin: PropTypes.func, - onBookmark: PropTypes.func, - withDismiss: PropTypes.bool, - intl: PropTypes.object.isRequired, + onPin : PropTypes.func, + onBookmark : PropTypes.func, + withDismiss : PropTypes.bool, + showReplyFormUnder: PropTypes.bool, + intl : PropTypes.object.isRequired, }; // Avoid checking props that are functions (and whose equality will always @@ -94,7 +95,7 @@ class StatusActionBar extends ImmutablePureComponent { 'status', 'relationship', 'withDismiss', - ] + ]; handleReplyClick = () => { if (me) { @@ -102,16 +103,19 @@ class StatusActionBar extends ImmutablePureComponent { } else { this._openInteractionDialog('reply'); } - } + }; + handleReplyUnderClick = () => { + this.props.showReplyFormUnder = true; + }; handleShareClick = () => { navigator.share({ text: this.props.status.get('search_index'), - url: this.props.status.get('url'), + url : this.props.status.get('url'), }).catch((e) => { if (e.name !== 'AbortError') console.error(e); }); - } + }; handleFavouriteClick = () => { if (me) { @@ -119,7 +123,7 @@ class StatusActionBar extends ImmutablePureComponent { } else { this._openInteractionDialog('favourite'); } - } + }; handleReblogClick = e => { if (me) { @@ -127,35 +131,35 @@ class StatusActionBar extends ImmutablePureComponent { } else { this._openInteractionDialog('reblog'); } - } + }; _openInteractionDialog = type => { window.open(`/interact/${this.props.status.get('id')}?type=${type}`, 'mastodon-intent', 'width=445,height=600,resizable=no,menubar=no,status=no,scrollbars=yes'); - } + }; handleBookmarkClick = () => { this.props.onBookmark(this.props.status); - } + }; handleDeleteClick = () => { this.props.onDelete(this.props.status, this.context.router.history); - } + }; handleRedraftClick = () => { this.props.onDelete(this.props.status, this.context.router.history, true); - } + }; handlePinClick = () => { this.props.onPin(this.props.status); - } + }; handleMentionClick = () => { this.props.onMention(this.props.status.get('account'), this.context.router.history); - } + }; handleDirectClick = () => { this.props.onDirect(this.props.status.get('account'), this.context.router.history); - } + }; handleMuteClick = () => { const { status, relationship, onMute, onUnmute } = this.props; @@ -166,7 +170,7 @@ class StatusActionBar extends ImmutablePureComponent { } else { onMute(account); } - } + }; handleBlockClick = () => { const { status, relationship, onBlock, onUnblock } = this.props; @@ -177,43 +181,43 @@ class StatusActionBar extends ImmutablePureComponent { } else { onBlock(status); } - } + }; handleBlockDomain = () => { const { status, onBlockDomain } = this.props; const account = status.get('account'); onBlockDomain(account.get('acct').split('@')[1]); - } + }; handleUnblockDomain = () => { const { status, onUnblockDomain } = this.props; const account = status.get('account'); onUnblockDomain(account.get('acct').split('@')[1]); - } + }; handleOpen = () => { this.context.router.history.push(`/statuses/${this.props.status.get('id')}`); - } + }; handleEmbed = () => { this.props.onEmbed(this.props.status); - } + }; handleReport = () => { this.props.onReport(this.props.status); - } + }; handleConversationMuteClick = () => { this.props.onMuteConversation(this.props.status); - } + }; handleCopy = () => { - const url = this.props.status.get('url'); + const url = this.props.status.get('url'); const textarea = document.createElement('textarea'); - textarea.textContent = url; + textarea.textContent = url; textarea.style.position = 'fixed'; document.body.appendChild(textarea); @@ -226,15 +230,15 @@ class StatusActionBar extends ImmutablePureComponent { } finally { document.body.removeChild(textarea); } - } + }; - render () { + render() { const { status, relationship, intl, withDismiss } = this.props; const mutingConversation = status.get('muted'); - const anonymousAccess = !me; - const publicStatus = ['public', 'unlisted'].includes(status.get('visibility')); - const account = status.get('account'); + const anonymousAccess = !me; + const publicStatus = ['public', 'unlisted'].includes(status.get('visibility')); + const account = status.get('account'); let menu = []; let reblogIcon = 'retweet'; @@ -248,43 +252,76 @@ class StatusActionBar extends ImmutablePureComponent { menu.push({ text: intl.formatMessage(messages.embed), action: this.handleEmbed }); } - menu.push({ text: intl.formatMessage(status.get('bookmarked') ? messages.removeBookmark : messages.bookmark), action: this.handleBookmarkClick }); + menu.push({ + text : intl.formatMessage(status.get('bookmarked') ? messages.removeBookmark : messages.bookmark), + action: this.handleBookmarkClick, + }); menu.push(null); if (status.getIn(['account', 'id']) === me || withDismiss) { - menu.push({ text: intl.formatMessage(mutingConversation ? messages.unmuteConversation : messages.muteConversation), action: this.handleConversationMuteClick }); + menu.push({ + text : intl.formatMessage(mutingConversation ? messages.unmuteConversation : messages.muteConversation), + action: this.handleConversationMuteClick, + }); menu.push(null); } if (status.getIn(['account', 'id']) === me) { if (publicStatus) { - menu.push({ text: intl.formatMessage(status.get('pinned') ? messages.unpin : messages.pin), action: this.handlePinClick }); + menu.push({ + text : intl.formatMessage(status.get('pinned') ? messages.unpin : messages.pin), + action: this.handlePinClick, + }); } else { if (status.get('visibility') === 'private') { - menu.push({ text: intl.formatMessage(status.get('reblogged') ? messages.cancel_reblog_private : messages.reblog_private), action: this.handleReblogClick }); + menu.push({ + text : intl.formatMessage(status.get('reblogged') ? messages.cancel_reblog_private : messages.reblog_private), + action: this.handleReblogClick, + }); } } menu.push({ text: intl.formatMessage(messages.delete), action: this.handleDeleteClick }); menu.push({ text: intl.formatMessage(messages.redraft), action: this.handleRedraftClick }); } else { - menu.push({ text: intl.formatMessage(messages.mention, { name: account.get('username') }), action: this.handleMentionClick }); - menu.push({ text: intl.formatMessage(messages.direct, { name: account.get('username') }), action: this.handleDirectClick }); + menu.push({ + text : intl.formatMessage(messages.mention, { name: account.get('username') }), + action: this.handleMentionClick, + }); + menu.push({ + text : intl.formatMessage(messages.direct, { name: account.get('username') }), + action: this.handleDirectClick, + }); menu.push(null); if (relationship && relationship.get('muting')) { - menu.push({ text: intl.formatMessage(messages.unmute, { name: account.get('username') }), action: this.handleMuteClick }); + menu.push({ + text : intl.formatMessage(messages.unmute, { name: account.get('username') }), + action: this.handleMuteClick, + }); } else { - menu.push({ text: intl.formatMessage(messages.mute, { name: account.get('username') }), action: this.handleMuteClick }); + menu.push({ + text : intl.formatMessage(messages.mute, { name: account.get('username') }), + action: this.handleMuteClick, + }); } if (relationship && relationship.get('blocking')) { - menu.push({ text: intl.formatMessage(messages.unblock, { name: account.get('username') }), action: this.handleBlockClick }); + menu.push({ + text : intl.formatMessage(messages.unblock, { name: account.get('username') }), + action: this.handleBlockClick, + }); } else { - menu.push({ text: intl.formatMessage(messages.block, { name: account.get('username') }), action: this.handleBlockClick }); + menu.push({ + text : intl.formatMessage(messages.block, { name: account.get('username') }), + action: this.handleBlockClick, + }); } - menu.push({ text: intl.formatMessage(messages.report, { name: account.get('username') }), action: this.handleReport }); + menu.push({ + text : intl.formatMessage(messages.report, { name: account.get('username') }), + action: this.handleReport, + }); if (account.get('acct') !== account.get('username')) { const domain = account.get('acct').split('@')[1]; @@ -300,8 +337,14 @@ class StatusActionBar extends ImmutablePureComponent { if (isStaff) { menu.push(null); - menu.push({ text: intl.formatMessage(messages.admin_account, { name: account.get('username') }), href: `/admin/accounts/${status.getIn(['account', 'id'])}` }); - menu.push({ text: intl.formatMessage(messages.admin_status), href: `/admin/accounts/${status.getIn(['account', 'id'])}/statuses/${status.get('id')}` }); + menu.push({ + text: intl.formatMessage(messages.admin_account, { name: account.get('username') }), + href: `/admin/accounts/${status.getIn(['account', 'id'])}`, + }); + menu.push({ + text: intl.formatMessage(messages.admin_status), + href: `/admin/accounts/${status.getIn(['account', 'id'])}/statuses/${status.get('id')}`, + }); } } @@ -320,20 +363,75 @@ class StatusActionBar extends ImmutablePureComponent { } const shareButton = ('share' in navigator) && status.get('visibility') === 'public' && ( - + ); return (
-
{obfuscatedCount(status.get('replies_count'))}
- - +
+ + + {this.props.showReplyFormUnder && ( + + yes + + )} + {obfuscatedCount(status.get('replies_count'))} + ({status.get('replies_count')}) +
+ + {shareButton}
- -
-
+ + + + {this.props.showReplyFormUnder && ( +
+ form de reply +
+ )} + ); } diff --git a/app/javascript/styles/bliss/admin.scss b/app/javascript/styles/bliss/admin.scss index f625bc139..30673402f 100644 --- a/app/javascript/styles/bliss/admin.scss +++ b/app/javascript/styles/bliss/admin.scss @@ -716,3 +716,9 @@ a.name-tag, text-overflow: ellipsis; vertical-align: middle; } + + +.administrate-stuff { + margin-right: 1ch; + color: $classic-highlight-color; +}