mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
⚡ link to administrate an account in posts
This commit is contained in:
parent
5eb8d00f25
commit
3194577ee2
@ -200,11 +200,11 @@ class Status extends ImmutablePureComponent {
|
|||||||
|
|
||||||
handleExpandedToggle = () => {
|
handleExpandedToggle = () => {
|
||||||
this.props.onToggleHidden(this._properStatus());
|
this.props.onToggleHidden(this._properStatus());
|
||||||
}
|
};
|
||||||
|
|
||||||
handleCollapsedToggle = isCollapsed => {
|
handleCollapsedToggle = isCollapsed => {
|
||||||
this.props.onToggleCollapsed(this._properStatus(), isCollapsed);
|
this.props.onToggleCollapsed(this._properStatus(), isCollapsed);
|
||||||
}
|
};
|
||||||
|
|
||||||
renderLoadingMediaGallery() {
|
renderLoadingMediaGallery() {
|
||||||
return (<div
|
return (<div
|
||||||
@ -417,7 +417,9 @@ class Status extends ImmutablePureComponent {
|
|||||||
account = status.get('account');
|
account = status.get('account');
|
||||||
status = status.get('reblog');
|
status = status.get('reblog');
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* manage attached medias
|
||||||
|
* */
|
||||||
if (status.get('media_attachments').size > 0) {
|
if (status.get('media_attachments').size > 0) {
|
||||||
if (this.props.muted) {
|
if (this.props.muted) {
|
||||||
media = (
|
media = (
|
||||||
@ -504,6 +506,9 @@ class Status extends ImmutablePureComponent {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* avatars
|
||||||
|
* */
|
||||||
if (otherAccounts && otherAccounts.size > 0) {
|
if (otherAccounts && otherAccounts.size > 0) {
|
||||||
statusAvatar = (<AvatarComposite
|
statusAvatar = (<AvatarComposite
|
||||||
accounts={otherAccounts}
|
accounts={otherAccounts}
|
||||||
@ -552,8 +557,11 @@ class Status extends ImmutablePureComponent {
|
|||||||
<div className='status__info'>
|
<div className='status__info'>
|
||||||
|
|
||||||
{isStaff && (<div className='administrate-stuff pull-left'>
|
{isStaff && (<div className='administrate-stuff pull-left'>
|
||||||
|
<a
|
||||||
|
href={`/admin/accounts/${status.getIn(['account', 'id'])}`}
|
||||||
|
>
|
||||||
<i className='fa fa-gears' />
|
<i className='fa fa-gears' />
|
||||||
|
</a >
|
||||||
</div >
|
</div >
|
||||||
)}
|
)}
|
||||||
<a
|
<a
|
||||||
@ -611,12 +619,12 @@ class Status extends ImmutablePureComponent {
|
|||||||
)}
|
)}
|
||||||
{/*<div className='well'>*/}
|
{/*<div className='well'>*/}
|
||||||
|
|
||||||
{/* {status.get('in_reply_to_account_id') === status.getIn(['account', 'id']) &&*/}
|
{/*{ isStaff && status.get('in_reply_to_account_id') === status.getIn(['account', 'id']) &&*/}
|
||||||
{/* <p > oui je cause tout seul, c'est un thread</p >*/}
|
{/*<p > oui je cause tout seul, c'est un thread</p >*/}
|
||||||
{/* }*/}
|
{/*}*/}
|
||||||
{/* {this.props.threadsCompile &&*/}
|
{/*{this.props.threadsCompile &&*/}
|
||||||
{/* <p > les threads sont en mode compilés</p >*/}
|
{/*<p > les threads sont en mode compilés</p >*/}
|
||||||
{/* }*/}
|
{/*}*/}
|
||||||
{/*</div >*/}
|
{/*</div >*/}
|
||||||
<StatusActionBar
|
<StatusActionBar
|
||||||
status={status}
|
status={status}
|
||||||
|
@ -6,40 +6,40 @@ import IconButton from './icon_button';
|
|||||||
import DropdownMenuContainer from '../containers/dropdown_menu_container';
|
import DropdownMenuContainer from '../containers/dropdown_menu_container';
|
||||||
import { defineMessages, injectIntl } from 'react-intl';
|
import { defineMessages, injectIntl } from 'react-intl';
|
||||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||||
import { me, isStaff } from '../initial_state';
|
import { isStaff, me } from '../initial_state';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
delete: { id: 'status.delete', defaultMessage: 'Delete' },
|
delete : { id: 'status.delete', defaultMessage: 'Delete' },
|
||||||
redraft: { id: 'status.redraft', defaultMessage: 'Delete & re-draft' },
|
redraft : { id: 'status.redraft', defaultMessage: 'Delete & re-draft' },
|
||||||
direct: { id: 'status.direct', defaultMessage: 'Direct message @{name}' },
|
direct : { id: 'status.direct', defaultMessage: 'Direct message @{name}' },
|
||||||
mention: { id: 'status.mention', defaultMessage: 'Mention @{name}' },
|
mention : { id: 'status.mention', defaultMessage: 'Mention @{name}' },
|
||||||
mute: { id: 'account.mute', defaultMessage: 'Mute @{name}' },
|
mute : { id: 'account.mute', defaultMessage: 'Mute @{name}' },
|
||||||
block: { id: 'account.block', defaultMessage: 'Block @{name}' },
|
block : { id: 'account.block', defaultMessage: 'Block @{name}' },
|
||||||
reply: { id: 'status.reply', defaultMessage: 'Reply' },
|
reply : { id: 'status.reply', defaultMessage: 'Reply' },
|
||||||
share: { id: 'status.share', defaultMessage: 'Share' },
|
share : { id: 'status.share', defaultMessage: 'Share' },
|
||||||
more: { id: 'status.more', defaultMessage: 'More' },
|
more : { id: 'status.more', defaultMessage: 'More' },
|
||||||
replyAll: { id: 'status.replyAll', defaultMessage: 'Reply to thread' },
|
replyAll : { id: 'status.replyAll', defaultMessage: 'Reply to thread' },
|
||||||
reblog: { id: 'status.reblog', defaultMessage: 'Boost' },
|
reblog : { id: 'status.reblog', defaultMessage: 'Boost' },
|
||||||
reblog_private: { id: 'status.reblog_private', defaultMessage: 'Boost to original audience' },
|
reblog_private : { id: 'status.reblog_private', defaultMessage: 'Boost to original audience' },
|
||||||
cancel_reblog_private: { id: 'status.cancel_reblog_private', defaultMessage: 'Unboost' },
|
cancel_reblog_private: { id: 'status.cancel_reblog_private', defaultMessage: 'Unboost' },
|
||||||
cannot_reblog: { id: 'status.cannot_reblog', defaultMessage: 'This post cannot be boosted' },
|
cannot_reblog : { id: 'status.cannot_reblog', defaultMessage: 'This post cannot be boosted' },
|
||||||
favourite: { id: 'status.favourite', defaultMessage: 'Favourite' },
|
favourite : { id: 'status.favourite', defaultMessage: 'Favourite' },
|
||||||
bookmark: { id: 'status.bookmark', defaultMessage: 'Bookmark' },
|
bookmark : { id: 'status.bookmark', defaultMessage: 'Bookmark' },
|
||||||
removeBookmark: { id: 'status.remove_bookmark', defaultMessage: 'Remove bookmark' },
|
removeBookmark : { id: 'status.remove_bookmark', defaultMessage: 'Remove bookmark' },
|
||||||
open: { id: 'status.open', defaultMessage: 'Expand this status' },
|
open : { id: 'status.open', defaultMessage: 'Expand this status' },
|
||||||
report: { id: 'status.report', defaultMessage: 'Report @{name}' },
|
report : { id: 'status.report', defaultMessage: 'Report @{name}' },
|
||||||
muteConversation: { id: 'status.mute_conversation', defaultMessage: 'Mute conversation' },
|
muteConversation : { id: 'status.mute_conversation', defaultMessage: 'Mute conversation' },
|
||||||
unmuteConversation: { id: 'status.unmute_conversation', defaultMessage: 'Unmute conversation' },
|
unmuteConversation : { id: 'status.unmute_conversation', defaultMessage: 'Unmute conversation' },
|
||||||
pin: { id: 'status.pin', defaultMessage: 'Pin on profile' },
|
pin : { id: 'status.pin', defaultMessage: 'Pin on profile' },
|
||||||
unpin: { id: 'status.unpin', defaultMessage: 'Unpin from profile' },
|
unpin : { id: 'status.unpin', defaultMessage: 'Unpin from profile' },
|
||||||
embed: { id: 'status.embed', defaultMessage: 'Embed' },
|
embed : { id: 'status.embed', defaultMessage: 'Embed' },
|
||||||
admin_account: { id: 'status.admin_account', defaultMessage: 'Open moderation interface for @{name}' },
|
admin_account : { id: 'status.admin_account', defaultMessage: 'Open moderation interface for @{name}' },
|
||||||
admin_status: { id: 'status.admin_status', defaultMessage: 'Open this status in the moderation interface' },
|
admin_status : { id: 'status.admin_status', defaultMessage: 'Open this status in the moderation interface' },
|
||||||
copy: { id: 'status.copy', defaultMessage: 'Copy link to status' },
|
copy : { id: 'status.copy', defaultMessage: 'Copy link to status' },
|
||||||
blockDomain: { id: 'account.block_domain', defaultMessage: 'Hide everything from {domain}' },
|
blockDomain : { id: 'account.block_domain', defaultMessage: 'Hide everything from {domain}' },
|
||||||
unblockDomain: { id: 'account.unblock_domain', defaultMessage: 'Unhide {domain}' },
|
unblockDomain : { id: 'account.unblock_domain', defaultMessage: 'Unhide {domain}' },
|
||||||
unmute: { id: 'account.unmute', defaultMessage: 'Unmute @{name}' },
|
unmute : { id: 'account.unmute', defaultMessage: 'Unmute @{name}' },
|
||||||
unblock: { id: 'account.unblock', defaultMessage: 'Unblock @{name}' },
|
unblock : { id: 'account.unblock', defaultMessage: 'Unblock @{name}' },
|
||||||
});
|
});
|
||||||
|
|
||||||
const obfuscatedCount = count => {
|
const obfuscatedCount = count => {
|
||||||
@ -65,27 +65,28 @@ class StatusActionBar extends ImmutablePureComponent {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
status: ImmutablePropTypes.map.isRequired,
|
status : ImmutablePropTypes.map.isRequired,
|
||||||
relationship: ImmutablePropTypes.map,
|
relationship : ImmutablePropTypes.map,
|
||||||
onReply: PropTypes.func,
|
onReply : PropTypes.func,
|
||||||
onFavourite: PropTypes.func,
|
onFavourite : PropTypes.func,
|
||||||
onReblog: PropTypes.func,
|
onReblog : PropTypes.func,
|
||||||
onDelete: PropTypes.func,
|
onDelete : PropTypes.func,
|
||||||
onDirect: PropTypes.func,
|
onDirect : PropTypes.func,
|
||||||
onMention: PropTypes.func,
|
onMention : PropTypes.func,
|
||||||
onMute: PropTypes.func,
|
onMute : PropTypes.func,
|
||||||
onUnmute: PropTypes.func,
|
onUnmute : PropTypes.func,
|
||||||
onBlock: PropTypes.func,
|
onBlock : PropTypes.func,
|
||||||
onUnblock: PropTypes.func,
|
onUnblock : PropTypes.func,
|
||||||
onBlockDomain: PropTypes.func,
|
onBlockDomain : PropTypes.func,
|
||||||
onUnblockDomain: PropTypes.func,
|
onUnblockDomain : PropTypes.func,
|
||||||
onReport: PropTypes.func,
|
onReport : PropTypes.func,
|
||||||
onEmbed: PropTypes.func,
|
onEmbed : PropTypes.func,
|
||||||
onMuteConversation: PropTypes.func,
|
onMuteConversation: PropTypes.func,
|
||||||
onPin: PropTypes.func,
|
onPin : PropTypes.func,
|
||||||
onBookmark: PropTypes.func,
|
onBookmark : PropTypes.func,
|
||||||
withDismiss: PropTypes.bool,
|
withDismiss : PropTypes.bool,
|
||||||
intl: PropTypes.object.isRequired,
|
showReplyFormUnder: PropTypes.bool,
|
||||||
|
intl : PropTypes.object.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Avoid checking props that are functions (and whose equality will always
|
// Avoid checking props that are functions (and whose equality will always
|
||||||
@ -94,7 +95,7 @@ class StatusActionBar extends ImmutablePureComponent {
|
|||||||
'status',
|
'status',
|
||||||
'relationship',
|
'relationship',
|
||||||
'withDismiss',
|
'withDismiss',
|
||||||
]
|
];
|
||||||
|
|
||||||
handleReplyClick = () => {
|
handleReplyClick = () => {
|
||||||
if (me) {
|
if (me) {
|
||||||
@ -102,16 +103,19 @@ class StatusActionBar extends ImmutablePureComponent {
|
|||||||
} else {
|
} else {
|
||||||
this._openInteractionDialog('reply');
|
this._openInteractionDialog('reply');
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
handleReplyUnderClick = () => {
|
||||||
|
this.props.showReplyFormUnder = true;
|
||||||
|
};
|
||||||
|
|
||||||
handleShareClick = () => {
|
handleShareClick = () => {
|
||||||
navigator.share({
|
navigator.share({
|
||||||
text: this.props.status.get('search_index'),
|
text: this.props.status.get('search_index'),
|
||||||
url: this.props.status.get('url'),
|
url : this.props.status.get('url'),
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
if (e.name !== 'AbortError') console.error(e);
|
if (e.name !== 'AbortError') console.error(e);
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
handleFavouriteClick = () => {
|
handleFavouriteClick = () => {
|
||||||
if (me) {
|
if (me) {
|
||||||
@ -119,7 +123,7 @@ class StatusActionBar extends ImmutablePureComponent {
|
|||||||
} else {
|
} else {
|
||||||
this._openInteractionDialog('favourite');
|
this._openInteractionDialog('favourite');
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleReblogClick = e => {
|
handleReblogClick = e => {
|
||||||
if (me) {
|
if (me) {
|
||||||
@ -127,35 +131,35 @@ class StatusActionBar extends ImmutablePureComponent {
|
|||||||
} else {
|
} else {
|
||||||
this._openInteractionDialog('reblog');
|
this._openInteractionDialog('reblog');
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
_openInteractionDialog = type => {
|
_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');
|
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 = () => {
|
handleBookmarkClick = () => {
|
||||||
this.props.onBookmark(this.props.status);
|
this.props.onBookmark(this.props.status);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleDeleteClick = () => {
|
handleDeleteClick = () => {
|
||||||
this.props.onDelete(this.props.status, this.context.router.history);
|
this.props.onDelete(this.props.status, this.context.router.history);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleRedraftClick = () => {
|
handleRedraftClick = () => {
|
||||||
this.props.onDelete(this.props.status, this.context.router.history, true);
|
this.props.onDelete(this.props.status, this.context.router.history, true);
|
||||||
}
|
};
|
||||||
|
|
||||||
handlePinClick = () => {
|
handlePinClick = () => {
|
||||||
this.props.onPin(this.props.status);
|
this.props.onPin(this.props.status);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMentionClick = () => {
|
handleMentionClick = () => {
|
||||||
this.props.onMention(this.props.status.get('account'), this.context.router.history);
|
this.props.onMention(this.props.status.get('account'), this.context.router.history);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleDirectClick = () => {
|
handleDirectClick = () => {
|
||||||
this.props.onDirect(this.props.status.get('account'), this.context.router.history);
|
this.props.onDirect(this.props.status.get('account'), this.context.router.history);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMuteClick = () => {
|
handleMuteClick = () => {
|
||||||
const { status, relationship, onMute, onUnmute } = this.props;
|
const { status, relationship, onMute, onUnmute } = this.props;
|
||||||
@ -166,7 +170,7 @@ class StatusActionBar extends ImmutablePureComponent {
|
|||||||
} else {
|
} else {
|
||||||
onMute(account);
|
onMute(account);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleBlockClick = () => {
|
handleBlockClick = () => {
|
||||||
const { status, relationship, onBlock, onUnblock } = this.props;
|
const { status, relationship, onBlock, onUnblock } = this.props;
|
||||||
@ -177,37 +181,37 @@ class StatusActionBar extends ImmutablePureComponent {
|
|||||||
} else {
|
} else {
|
||||||
onBlock(status);
|
onBlock(status);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleBlockDomain = () => {
|
handleBlockDomain = () => {
|
||||||
const { status, onBlockDomain } = this.props;
|
const { status, onBlockDomain } = this.props;
|
||||||
const account = status.get('account');
|
const account = status.get('account');
|
||||||
|
|
||||||
onBlockDomain(account.get('acct').split('@')[1]);
|
onBlockDomain(account.get('acct').split('@')[1]);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleUnblockDomain = () => {
|
handleUnblockDomain = () => {
|
||||||
const { status, onUnblockDomain } = this.props;
|
const { status, onUnblockDomain } = this.props;
|
||||||
const account = status.get('account');
|
const account = status.get('account');
|
||||||
|
|
||||||
onUnblockDomain(account.get('acct').split('@')[1]);
|
onUnblockDomain(account.get('acct').split('@')[1]);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleOpen = () => {
|
handleOpen = () => {
|
||||||
this.context.router.history.push(`/statuses/${this.props.status.get('id')}`);
|
this.context.router.history.push(`/statuses/${this.props.status.get('id')}`);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleEmbed = () => {
|
handleEmbed = () => {
|
||||||
this.props.onEmbed(this.props.status);
|
this.props.onEmbed(this.props.status);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleReport = () => {
|
handleReport = () => {
|
||||||
this.props.onReport(this.props.status);
|
this.props.onReport(this.props.status);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleConversationMuteClick = () => {
|
handleConversationMuteClick = () => {
|
||||||
this.props.onMuteConversation(this.props.status);
|
this.props.onMuteConversation(this.props.status);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleCopy = () => {
|
handleCopy = () => {
|
||||||
const url = this.props.status.get('url');
|
const url = this.props.status.get('url');
|
||||||
@ -226,9 +230,9 @@ class StatusActionBar extends ImmutablePureComponent {
|
|||||||
} finally {
|
} finally {
|
||||||
document.body.removeChild(textarea);
|
document.body.removeChild(textarea);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render() {
|
||||||
const { status, relationship, intl, withDismiss } = this.props;
|
const { status, relationship, intl, withDismiss } = this.props;
|
||||||
|
|
||||||
const mutingConversation = status.get('muted');
|
const mutingConversation = status.get('muted');
|
||||||
@ -248,43 +252,76 @@ class StatusActionBar extends ImmutablePureComponent {
|
|||||||
menu.push({ text: intl.formatMessage(messages.embed), action: this.handleEmbed });
|
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);
|
menu.push(null);
|
||||||
|
|
||||||
if (status.getIn(['account', 'id']) === me || withDismiss) {
|
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);
|
menu.push(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status.getIn(['account', 'id']) === me) {
|
if (status.getIn(['account', 'id']) === me) {
|
||||||
if (publicStatus) {
|
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 {
|
} else {
|
||||||
if (status.get('visibility') === 'private') {
|
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.delete), action: this.handleDeleteClick });
|
||||||
menu.push({ text: intl.formatMessage(messages.redraft), action: this.handleRedraftClick });
|
menu.push({ text: intl.formatMessage(messages.redraft), action: this.handleRedraftClick });
|
||||||
} else {
|
} else {
|
||||||
menu.push({ text: intl.formatMessage(messages.mention, { name: account.get('username') }), action: this.handleMentionClick });
|
menu.push({
|
||||||
menu.push({ text: intl.formatMessage(messages.direct, { name: account.get('username') }), action: this.handleDirectClick });
|
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);
|
menu.push(null);
|
||||||
|
|
||||||
if (relationship && relationship.get('muting')) {
|
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 {
|
} 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')) {
|
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 {
|
} 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')) {
|
if (account.get('acct') !== account.get('username')) {
|
||||||
const domain = account.get('acct').split('@')[1];
|
const domain = account.get('acct').split('@')[1];
|
||||||
@ -300,8 +337,14 @@ class StatusActionBar extends ImmutablePureComponent {
|
|||||||
|
|
||||||
if (isStaff) {
|
if (isStaff) {
|
||||||
menu.push(null);
|
menu.push(null);
|
||||||
menu.push({ text: intl.formatMessage(messages.admin_account, { name: account.get('username') }), href: `/admin/accounts/${status.getIn(['account', 'id'])}` });
|
menu.push({
|
||||||
menu.push({ text: intl.formatMessage(messages.admin_status), href: `/admin/accounts/${status.getIn(['account', 'id'])}/statuses/${status.get('id')}` });
|
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' && (
|
const shareButton = ('share' in navigator) && status.get('visibility') === 'public' && (
|
||||||
<IconButton className='status__action-bar-button' title={intl.formatMessage(messages.share)} icon='share-alt' onClick={this.handleShareClick} />
|
<IconButton
|
||||||
|
className='status__action-bar-button'
|
||||||
|
title={intl.formatMessage(messages.share)}
|
||||||
|
icon='share-alt'
|
||||||
|
onClick={this.handleShareClick}
|
||||||
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='status__action-bar'>
|
<div className='status__action-bar'>
|
||||||
<div className='status__action-bar__counter'><IconButton className='status__action-bar-button' title={replyTitle} icon={status.get('in_reply_to_account_id') === status.getIn(['account', 'id']) ? 'reply' : replyIcon} onClick={this.handleReplyClick} /><span className='status__action-bar__counter__label' >{obfuscatedCount(status.get('replies_count'))}</span></div>
|
<div className='status__action-bar__counter'>
|
||||||
<IconButton className='status__action-bar-button' disabled={!publicStatus} active={status.get('reblogged')} pressed={status.get('reblogged')} title={!publicStatus ? intl.formatMessage(messages.cannot_reblog) : intl.formatMessage(messages.reblog)} icon={reblogIcon} onClick={this.handleReblogClick} />
|
<IconButton
|
||||||
<IconButton className='status__action-bar-button star-icon' animate active={status.get('favourited')} pressed={status.get('favourited')} title={intl.formatMessage(messages.favourite)} icon='star' onClick={this.handleFavouriteClick} />
|
className='status__action-bar-button'
|
||||||
|
title={replyTitle}
|
||||||
|
icon={status.get('in_reply_to_account_id') === status.getIn(['account', 'id']) ? 'reply' : replyIcon}
|
||||||
|
onClick={this.handleReplyClick}
|
||||||
|
/>
|
||||||
|
<IconButton
|
||||||
|
className='status__action-bar-button reply_under'
|
||||||
|
title={replyTitle}
|
||||||
|
icon={status.get('in_reply_to_account_id') === status.getIn(['account', 'id']) ? 'reply' : replyIcon}
|
||||||
|
onClick={this.handleReplyUnderClick}
|
||||||
|
/>
|
||||||
|
{this.props.showReplyFormUnder && (
|
||||||
|
<span >
|
||||||
|
yes
|
||||||
|
</span >
|
||||||
|
)}
|
||||||
|
<span className='status__action-bar__counter__label'>{obfuscatedCount(status.get('replies_count'))}</span >
|
||||||
|
<span className='status__action-bar__counter__label'>({status.get('replies_count')})</span >
|
||||||
|
</div >
|
||||||
|
<IconButton
|
||||||
|
className='status__action-bar-button'
|
||||||
|
disabled={!publicStatus}
|
||||||
|
active={status.get('reblogged')}
|
||||||
|
pressed={status.get('reblogged')}
|
||||||
|
title={!publicStatus ? intl.formatMessage(messages.cannot_reblog) : intl.formatMessage(messages.reblog)}
|
||||||
|
icon={reblogIcon}
|
||||||
|
onClick={this.handleReblogClick}
|
||||||
|
/>
|
||||||
|
<IconButton
|
||||||
|
className='status__action-bar-button star-icon'
|
||||||
|
animate
|
||||||
|
active={status.get('favourited')}
|
||||||
|
pressed={status.get('favourited')}
|
||||||
|
title={intl.formatMessage(messages.favourite)}
|
||||||
|
icon='star'
|
||||||
|
onClick={this.handleFavouriteClick}
|
||||||
|
/>
|
||||||
{shareButton}
|
{shareButton}
|
||||||
|
|
||||||
<div className='status__action-bar-dropdown'>
|
<div className='status__action-bar-dropdown'>
|
||||||
<DropdownMenuContainer disabled={anonymousAccess} status={status} items={menu} icon='ellipsis-h' size={18} direction='right' title={intl.formatMessage(messages.more)} />
|
<DropdownMenuContainer
|
||||||
</div>
|
disabled={anonymousAccess}
|
||||||
</div>
|
status={status}
|
||||||
|
items={menu}
|
||||||
|
icon='ellipsis-h'
|
||||||
|
size={18}
|
||||||
|
direction='right'
|
||||||
|
title={intl.formatMessage(messages.more)}
|
||||||
|
/>
|
||||||
|
</div >
|
||||||
|
|
||||||
|
{this.props.showReplyFormUnder && (
|
||||||
|
<div className='reply_form'>
|
||||||
|
form de reply
|
||||||
|
</div >
|
||||||
|
)}
|
||||||
|
</div >
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -716,3 +716,9 @@ a.name-tag,
|
|||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.administrate-stuff {
|
||||||
|
margin-right: 1ch;
|
||||||
|
color: $classic-highlight-color;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user