Add “staff” badge to admin user pages (#5735)
* Allow staff badge to change from setting to hidden * i18n: Update Polish translation
This commit is contained in:
committed by
Eugen Rochko
parent
b380e9d2cb
commit
bfdcf76a64
@ -13,6 +13,7 @@ module Admin
|
||||
closed_registrations_message
|
||||
open_deletion
|
||||
timeline_preview
|
||||
show_staff_badge
|
||||
bootstrap_timeline_accounts
|
||||
thumbnail
|
||||
).freeze
|
||||
@ -21,6 +22,7 @@ module Admin
|
||||
open_registrations
|
||||
open_deletion
|
||||
timeline_preview
|
||||
show_staff_badge
|
||||
).freeze
|
||||
|
||||
UPLOAD_SETTINGS = %w(
|
||||
|
@ -24,6 +24,8 @@ class Form::AdminSettings
|
||||
:open_deletion=,
|
||||
:timeline_preview,
|
||||
:timeline_preview=,
|
||||
:show_staff_badge,
|
||||
:show_staff_badge=,
|
||||
:bootstrap_timeline_accounts,
|
||||
:bootstrap_timeline_accounts=,
|
||||
to: Setting
|
||||
|
@ -27,14 +27,15 @@
|
||||
%span @#{account.local_username_and_domain}
|
||||
= fa_icon('lock') if account.locked?
|
||||
|
||||
- if account.user_admin?
|
||||
.roles
|
||||
.account-role.admin
|
||||
= t 'accounts.roles.admin'
|
||||
- elsif account.user_moderator?
|
||||
.roles
|
||||
.account-role.moderator
|
||||
= t 'accounts.roles.moderator'
|
||||
- if Setting.show_staff_badge
|
||||
- if account.user_admin?
|
||||
.roles
|
||||
.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)
|
||||
|
@ -18,6 +18,9 @@
|
||||
.fields-group
|
||||
= f.input :timeline_preview, as: :boolean, wrapper: :with_label, label: t('admin.settings.timeline_preview.title'), hint: t('admin.settings.timeline_preview.desc_html')
|
||||
|
||||
.fields-group
|
||||
= f.input :show_staff_badge, as: :boolean, wrapper: :with_label, label: t('admin.settings.show_staff_badge.title'), hint: t('admin.settings.show_staff_badge.desc_html')
|
||||
|
||||
.fields-group
|
||||
= f.input :open_registrations, as: :boolean, wrapper: :with_label, label: t('admin.settings.registrations.open.title'), hint: t('admin.settings.registrations.open.desc_html')
|
||||
|
||||
|
Reference in New Issue
Block a user