1
0
Fork 0
forked from gitea/nas

Merge commit 'f05fb51ecb' into kb_migration

This commit is contained in:
KMY 2023-04-15 14:45:56 +09:00
commit d4bec28e1e
9 changed files with 40 additions and 15 deletions

View file

@ -555,7 +555,7 @@ class Status extends ImmutablePureComponent {
expanded={!status.get('hidden')}
onExpandedToggle={this.handleExpandedToggle}
onTranslate={this.handleTranslate}
collapsable
collapsible
onCollapsedToggle={this.handleCollapsedToggle}
/>

View file

@ -65,7 +65,7 @@ class StatusContent extends React.PureComponent {
onExpandedToggle: PropTypes.func,
onTranslate: PropTypes.func,
onClick: PropTypes.func,
collapsable: PropTypes.bool,
collapsible: PropTypes.bool,
onCollapsedToggle: PropTypes.func,
languages: ImmutablePropTypes.map,
intl: PropTypes.object,
@ -112,10 +112,10 @@ class StatusContent extends React.PureComponent {
}
if (status.get('collapsed', null) === null && onCollapsedToggle) {
const { collapsable, onClick } = this.props;
const { collapsible, onClick } = this.props;
const collapsed =
collapsable
collapsible
&& onClick
&& node.clientHeight > MAX_HEIGHT
&& status.get('spoiler_text').length === 0;

View file

@ -165,7 +165,7 @@ class Conversation extends ImmutablePureComponent {
onClick={this.handleClick}
expanded={!lastStatus.get('hidden')}
onExpandedToggle={this.handleShowMore}
collapsable
collapsible
/>
{lastStatus.get('media_attachments').size > 0 && (

View file

@ -71,6 +71,7 @@ const messages = defineMessages({
redraftMessage: { id: 'confirmations.redraft.message', defaultMessage: 'Are you sure you want to delete this status and re-draft it? Favourites and boosts will be lost, and replies to the original post will be orphaned.' },
revealAll: { id: 'status.show_more_all', defaultMessage: 'Show more for all' },
hideAll: { id: 'status.show_less_all', defaultMessage: 'Show less for all' },
statusTitleWithAttachments: { id: 'status.title.with_attachments', defaultMessage: '{user} posted {attachmentCount, plural, one {an attachment} other {{attachmentCount} attachments}}' },
detailedStatus: { id: 'status.detailed_status', defaultMessage: 'Detailed conversation view' },
replyConfirm: { id: 'confirmations.reply.confirm', defaultMessage: 'Reply' },
replyMessage: { id: 'confirmations.reply.message', defaultMessage: 'Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?' },
@ -168,13 +169,14 @@ const truncate = (str, num) => {
}
};
const titleFromStatus = status => {
const titleFromStatus = (intl, status) => {
const displayName = status.getIn(['account', 'display_name']);
const username = status.getIn(['account', 'username']);
const prefix = displayName.trim().length === 0 ? username : displayName;
const user = displayName.trim().length === 0 ? username : displayName;
const text = status.get('search_index');
const attachmentCount = status.get('media_attachments').size;
return `${prefix}: "${truncate(text, 30)}"`;
return text ? `${user}: "${truncate(text, 30)}"` : intl.formatMessage(messages.statusTitleWithAttachments, { user, attachmentCount });
};
class Status extends ImmutablePureComponent {
@ -695,7 +697,7 @@ class Status extends ImmutablePureComponent {
</ScrollContainer>
<Helmet>
<title>{titleFromStatus(status)}</title>
<title>{titleFromStatus(intl, status)}</title>
<meta name='robots' content={(isLocal && isIndexable) ? 'all' : 'noindex'} />
</Helmet>
</Column>

View file

@ -3732,6 +3732,10 @@
"defaultMessage": "Show less for all",
"id": "status.show_less_all"
},
{
"defaultMessage": "{user} posted {attachmentCount, plural, one {an attachment} other {{attachmentCount} attachments}}",
"id": "status.title.with_attachments"
},
{
"defaultMessage": "Detailed conversation view",
"id": "status.detailed_status"

View file

@ -611,6 +611,7 @@
"status.show_more": "Show more",
"status.show_more_all": "Show more for all",
"status.show_original": "Show original",
"status.title.with_attachments": "{user} posted {attachmentCount, plural, one {an attachment} other {{attachmentCount} attachments}}",
"status.translate": "Translate",
"status.translated_from_with": "Translated from {lang} using {provider}",
"status.uncached_media_warning": "Not available",

View file

@ -597,6 +597,7 @@
"status.show_more": "Mostrar más",
"status.show_more_all": "Mostrar más para todo",
"status.show_original": "Mostrar original",
"status.title.with_attachments": "{user} publicó {attachmentCount, plural, one {un archivo adjunto} other {{attachmentCount} archivos adjuntos}}",
"status.translate": "Traducir",
"status.translated_from_with": "Traducido del {lang} usando {provider}",
"status.uncached_media_warning": "No disponible",