From 2151fd315023a7f6849c6c9a519cd01deac09aa1 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 17 Nov 2017 01:22:38 +0100 Subject: [PATCH] Display moderator badge (green), admin badge changed to red (#5728) --- app/javascript/styles/mastodon/accounts.scss | 18 +++++++++++++++--- app/models/account.rb | 2 ++ app/views/accounts/_header.html.haml | 6 +++++- config/locales/en.yml | 1 + 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/app/javascript/styles/mastodon/accounts.scss b/app/javascript/styles/mastodon/accounts.scss index 30adf8cdc9..ca55de28de 100644 --- a/app/javascript/styles/mastodon/accounts.scss +++ b/app/javascript/styles/mastodon/accounts.scss @@ -531,7 +531,19 @@ font-size: 12px; line-height: 12px; font-weight: 500; - color: $success-green; - background-color: rgba($success-green, 0.1); - border: 1px solid rgba($success-green, 0.5); + color: $ui-secondary-color; + background-color: rgba($ui-secondary-color, 0.1); + border: 1px solid rgba($ui-secondary-color, 0.5); + + &.moderator { + color: $success-green; + background-color: rgba($success-green, 0.1); + border-color: rgba($success-green, 0.5); + } + + &.admin { + color: $error-red; + background-color: rgba($error-red, 0.1); + border-color: rgba($error-red, 0.5); + } } diff --git a/app/models/account.rb b/app/models/account.rb index 6f6010f7af..bc01d24483 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -115,6 +115,8 @@ class Account < ApplicationRecord :current_sign_in_at, :confirmed?, :admin?, + :moderator?, + :staff?, :locale, to: :user, prefix: true, diff --git a/app/views/accounts/_header.html.haml b/app/views/accounts/_header.html.haml index 5530fcc200..e4c258acda 100644 --- a/app/views/accounts/_header.html.haml +++ b/app/views/accounts/_header.html.haml @@ -29,8 +29,12 @@ - if account.user_admin? .roles - .account-role + .account-role.admin = t 'accounts.roles.admin' + - elsif account.user_moderator? + .roles + .account-role.moderator + = t 'accounts.roles.moderator' .bio .account__header__content.p-note.emojify= Formatter.instance.simplified_format(account) diff --git a/config/locales/en.yml b/config/locales/en.yml index e941653172..11c34b912c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -48,6 +48,7 @@ en: reserved_username: The username is reserved roles: admin: Admin + moderator: Mod unfollow: Unfollow admin: account_moderation_notes: