Skip to content
Extraits de code Groupes Projets
Valider bfdcf76a rédigé par Yamagishi Kazutoshi's avatar Yamagishi Kazutoshi Validation de Eugen Rochko
Parcourir les fichiers

Add “staff” badge to admin user pages (#5735)

* Allow staff badge to change from setting to hidden

* i18n: Update Polish translation
parent b380e9d2
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -13,6 +13,7 @@ module Admin ...@@ -13,6 +13,7 @@ module Admin
closed_registrations_message closed_registrations_message
open_deletion open_deletion
timeline_preview timeline_preview
show_staff_badge
bootstrap_timeline_accounts bootstrap_timeline_accounts
thumbnail thumbnail
).freeze ).freeze
...@@ -21,6 +22,7 @@ module Admin ...@@ -21,6 +22,7 @@ module Admin
open_registrations open_registrations
open_deletion open_deletion
timeline_preview timeline_preview
show_staff_badge
).freeze ).freeze
UPLOAD_SETTINGS = %w( UPLOAD_SETTINGS = %w(
......
...@@ -24,6 +24,8 @@ class Form::AdminSettings ...@@ -24,6 +24,8 @@ class Form::AdminSettings
:open_deletion=, :open_deletion=,
:timeline_preview, :timeline_preview,
:timeline_preview=, :timeline_preview=,
:show_staff_badge,
:show_staff_badge=,
:bootstrap_timeline_accounts, :bootstrap_timeline_accounts,
:bootstrap_timeline_accounts=, :bootstrap_timeline_accounts=,
to: Setting to: Setting
......
...@@ -27,14 +27,15 @@ ...@@ -27,14 +27,15 @@
%span @#{account.local_username_and_domain} %span @#{account.local_username_and_domain}
= fa_icon('lock') if account.locked? = fa_icon('lock') if account.locked?
- if account.user_admin? - if Setting.show_staff_badge
.roles - if account.user_admin?
.account-role.admin .roles
= t 'accounts.roles.admin' .account-role.admin
- elsif account.user_moderator? = t 'accounts.roles.admin'
.roles - elsif account.user_moderator?
.account-role.moderator .roles
= t 'accounts.roles.moderator' .account-role.moderator
= t 'accounts.roles.moderator'
.bio .bio
.account__header__content.p-note.emojify= Formatter.instance.simplified_format(account) .account__header__content.p-note.emojify= Formatter.instance.simplified_format(account)
......
...@@ -18,6 +18,9 @@ ...@@ -18,6 +18,9 @@
.fields-group .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') = 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 .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') = f.input :open_registrations, as: :boolean, wrapper: :with_label, label: t('admin.settings.registrations.open.title'), hint: t('admin.settings.registrations.open.desc_html')
......
...@@ -246,6 +246,9 @@ en: ...@@ -246,6 +246,9 @@ en:
open: open:
desc_html: Allow anyone to create an account desc_html: Allow anyone to create an account
title: Open registration title: Open registration
show_staff_badge:
desc_html: Show a staff badge on a user page
title: Show staff badge
site_description: site_description:
desc_html: Introductory paragraph on the frontpage and in meta tags. You can use HTML tags, in particular <code>&lt;a&gt;</code> and <code>&lt;em&gt;</code>. desc_html: Introductory paragraph on the frontpage and in meta tags. You can use HTML tags, in particular <code>&lt;a&gt;</code> and <code>&lt;em&gt;</code>.
title: Instance description title: Instance description
......
...@@ -245,6 +245,9 @@ pl: ...@@ -245,6 +245,9 @@ pl:
open: open:
desc_html: Pozwól każdemu na założenie konta desc_html: Pozwól każdemu na założenie konta
title: Otwarta rejestracja title: Otwarta rejestracja
show_staff_badge:
desc_html: Pokazuj odznakę uprawnień na stronie profilu użytkownika
title: Pokazuj odznakę administracji
site_description: site_description:
desc_html: Akapit wprowadzający, widoczny na stronie głównej i znacznikach meta. Możesz korzystać z tagów HTML, w szczególności <code>&lt;a&gt;</code> i <code>&lt;em&gt;</code>. desc_html: Akapit wprowadzający, widoczny na stronie głównej i znacznikach meta. Możesz korzystać z tagów HTML, w szczególności <code>&lt;a&gt;</code> i <code>&lt;em&gt;</code>.
title: Opis instancji title: Opis instancji
......
...@@ -17,6 +17,7 @@ defaults: &defaults ...@@ -17,6 +17,7 @@ defaults: &defaults
closed_registrations_message: '' closed_registrations_message: ''
open_deletion: true open_deletion: true
timeline_preview: true timeline_preview: true
show_staff_badge: true
default_sensitive: false default_sensitive: false
unfollow_modal: false unfollow_modal: false
boost_modal: false boost_modal: false
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter