From 3fda862ea004c1c417a442b2a8f38a67d0535979 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Fri, 19 Jul 2019 14:53:13 -0500 Subject: add badge to ui for locked accounts --- app/helpers/stream_entries_helper.rb | 1 + .../flavours/glitch/features/account/components/header.js | 4 +++- app/javascript/flavours/glitch/styles/accounts.scss | 6 ++++++ app/javascript/mastodon/locales/en.json | 1 + config/locales/en.yml | 5 +++-- 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/helpers/stream_entries_helper.rb b/app/helpers/stream_entries_helper.rb index fe8505f3b..ed58efdb4 100644 --- a/app/helpers/stream_entries_helper.rb +++ b/app/helpers/stream_entries_helper.rb @@ -37,6 +37,7 @@ module StreamEntriesHelper def account_badge(account, all: false) content_tag(:div, class: 'roles') do roles = [] + roles << content_tag(:div, t('accounts.roles.locked'), class: 'account-role locked') if account.locked? roles << content_tag(:div, t('accounts.roles.bot'), class: 'account-role bot') if account.bot? roles << content_tag(:div, t('accounts.roles.adult'), class: 'account-role adult') if account.adult_content? roles << content_tag(:div, t('accounts.roles.gently'), class: 'account-role gently') if account.gently? diff --git a/app/javascript/flavours/glitch/features/account/components/header.js b/app/javascript/flavours/glitch/features/account/components/header.js index 2b4adb4f5..0f03770b7 100644 --- a/app/javascript/flavours/glitch/features/account/components/header.js +++ b/app/javascript/flavours/glitch/features/account/components/header.js @@ -189,6 +189,8 @@ class Header extends ImmutablePureComponent { const content = { __html: account.get('note_emojified') }; const displayNameHtml = { __html: account.get('display_name_html') }; const fields = account.get('fields'); + + const badge_locked = account.get('locked') ? (
) : null; const badge_bot = account.get('bot') ? (
) : null; const badge_ac = account.get('adult_content') ? (
) : null; const badge_gently = account.get('gently') ? (
) : null; @@ -226,7 +228,7 @@ class Header extends ImmutablePureComponent {

@{acct} {lockedIcon} -
{badge_admin}{badge_mod}{badge_ac}{badge_bot}{badge_gently}{badge_kobold}
+
{badge_locked}{badge_admin}{badge_mod}{badge_ac}{badge_bot}{badge_gently}{badge_kobold}

diff --git a/app/javascript/flavours/glitch/styles/accounts.scss b/app/javascript/flavours/glitch/styles/accounts.scss index 65c7fc80c..49236fe4c 100644 --- a/app/javascript/flavours/glitch/styles/accounts.scss +++ b/app/javascript/flavours/glitch/styles/accounts.scss @@ -234,6 +234,12 @@ background-color: rgba(lighten(orange, 33%), 0.1); border-color: rgba(lighten(orange, 33%), 0.1); } + + &.locked { + color: lighten($warning-red, 12%); + background-color: rgba(lighten($warning-red, 12%), 0.1); + border-color: rgba(lighten($warning-red, 12%), 0.5); + } } .account__header__fields { diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index 53166a19b..d61277d76 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -4,6 +4,7 @@ "account.badges.adult": "🔞 Adult content", "account.badges.gently": "Gentlies kobolds", "account.badges.kobold": "Gently the kobold", + "account.badges.locked": "🔒 Locked", "account.block": "Block @{name}", "account.block_domain": "Hide {domain}", "account.blocked": "Blocked", diff --git a/config/locales/en.yml b/config/locales/en.yml index e95526e2c..705cbf793 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -73,8 +73,9 @@ en: bot: Bot moderator: Mod kobold: Gently the kobold - gentlies_kobolds: Gentlies kobolds - adults_only: 🔞 Adult content + gently: Gentlies kobolds + adult_content: 🔞 Adult content + locked: 🔒 Locked unavailable: Profile unavailable unfollow: Unfollow admin: -- cgit