Skip to content

Commit

Permalink
Change Profile Views
Browse files Browse the repository at this point in the history
  • Loading branch information
atsu1125 committed Oct 20, 2022
1 parent ea5b6aa commit 19f98ea
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
2 changes: 2 additions & 0 deletions app/helpers/accounts_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ def minimal_account_action_button(account)
def account_badge(account, all: false)
if account.bot?
content_tag(:div, content_tag(:div, t('accounts.roles.bot'), class: 'account-role bot'), class: 'roles')
elsif account.cat?
content_tag(:div, content_tag(:div, t('accounts.roles.cat'), class: 'account-role cat'), class: 'roles')
elsif account.group?
content_tag(:div, content_tag(:div, t('accounts.roles.group'), class: 'account-role group'), class: 'roles')
elsif (Setting.show_staff_badge && account.user_staff?) || all
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ class Header extends ImmutablePureComponent {
menu.push(null);
}

menu.push({ text: intl.formatMessage(messages.add_or_remove_from_list), action: this.props.onAddToList });

if (account.getIn(['relationship', 'muting'])) {
menu.push({ text: intl.formatMessage(messages.unmute, { name: account.get('username') }), action: this.props.onMute });
} else {
Expand All @@ -228,7 +230,6 @@ class Header extends ImmutablePureComponent {
}

menu.push({ text: intl.formatMessage(messages.report, { name: account.get('username') }), action: this.props.onReport });
menu.push({ text: intl.formatMessage(messages.add_or_remove_from_list), action: this.props.onAddToList });
}

if (account.get('acct') !== account.get('username')) {
Expand Down Expand Up @@ -259,6 +260,8 @@ class Header extends ImmutablePureComponent {
badge = (<div className='account-role bot'><FormattedMessage id='account.badges.bot' defaultMessage='Bot' /></div>);
} else if (account.get('group')) {
badge = (<div className='account-role group'><FormattedMessage id='account.badges.group' defaultMessage='Group' /></div>);
} else if (account.get('cat')) {
badge = (<div className='account-role cat'><FormattedMessage id='account.badges.cat' defaultMessage='Cat' /></div>);
} else {
badge = null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ class Header extends ImmutablePureComponent {
menu.push(null);
}

menu.push({ text: intl.formatMessage(messages.add_or_remove_from_list), action: this.props.onAddToList });

if (account.getIn(['relationship', 'muting'])) {
menu.push({ text: intl.formatMessage(messages.unmute, { name: account.get('username') }), action: this.props.onMute });
} else {
Expand All @@ -225,7 +227,6 @@ class Header extends ImmutablePureComponent {
}

menu.push({ text: intl.formatMessage(messages.report, { name: account.get('username') }), action: this.props.onReport });
menu.push({ text: intl.formatMessage(messages.add_or_remove_from_list), action: this.props.onAddToList });
}

if (account.get('acct') !== account.get('username')) {
Expand Down Expand Up @@ -256,6 +257,8 @@ class Header extends ImmutablePureComponent {

if (account.get('bot')) {
badge = (<div className='account-role bot'><FormattedMessage id='account.badges.bot' defaultMessage='Bot' /></div>);
} else if (account.get('cat')) {
badge = (<div className='account-role cat'><FormattedMessage id='account.badges.cat' defaultMessage='Cat' /></div>);
} else if (account.get('group')) {
badge = (<div className='account-role group'><FormattedMessage id='account.badges.group' defaultMessage='Group' /></div>);
} else {
Expand Down
6 changes: 5 additions & 1 deletion app/javascript/mastodon/locales/defaultMessages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,10 @@
"defaultMessage": "Bot",
"id": "account.badges.bot"
},
{
"defaultMessage": "Cat",
"id": "account.badges.cat"
},
{
"defaultMessage": "Group",
"id": "account.badges.group"
Expand Down Expand Up @@ -3423,4 +3427,4 @@
],
"path": "app/javascript/mastodon/features/video/index.json"
}
]
]
1 change: 1 addition & 0 deletions app/javascript/mastodon/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"account.account_note_header": "Note",
"account.add_or_remove_from_list": "Add or Remove from lists",
"account.badges.bot": "Bot",
"account.badges.cat": "Cat",
"account.badges.group": "Group",
"account.block": "Block @{name}",
"account.block_domain": "Block domain {domain}",
Expand Down

0 comments on commit 19f98ea

Please sign in to comment.