Add setting to hide moderator badge

This commit is contained in:
noellabo 2022-06-28 14:17:13 +09:00
parent 0124a17cf1
commit dc76262f26
6 changed files with 13 additions and 1 deletions

View file

@ -70,7 +70,7 @@ module AccountsHelper
content_tag(:div, t('admin.accounts.roles.user'), class: 'account-role')
elsif account.user_admin?
content_tag(:div, t('accounts.roles.admin'), class: 'account-role admin')
elsif account.user_moderator?
elsif Setting.show_moderator_badge && account.user_moderator?
content_tag(:div, t('accounts.roles.moderator'), class: 'account-role moderator')
end
end

View file

@ -16,6 +16,7 @@ class Form::AdminSettings
open_deletion
timeline_preview
show_staff_badge
show_moderator_badge
bootstrap_timeline_accounts
theme
min_invite_role
@ -40,6 +41,7 @@ class Form::AdminSettings
open_deletion
timeline_preview
show_staff_badge
show_moderator_badge
activity_api_enabled
peers_api_enabled
show_known_fediverse_at_about_page

View file

@ -64,6 +64,9 @@
.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 :show_moderator_badge, as: :boolean, wrapper: :with_label, label: t('admin.settings.show_moderator_badge.title'), hint: t('admin.settings.show_moderator_badge.desc_html'), fedibird_features: true
.fields-group
= f.input :open_deletion, as: :boolean, wrapper: :with_label, label: t('admin.settings.registrations.deletion.title'), hint: t('admin.settings.registrations.deletion.desc_html')

View file

@ -666,6 +666,9 @@ en:
show_known_fediverse_at_about_page:
desc_html: When disabled, restricts the public timeline linked from the landing page to showing only local content
title: Include federated content on unauthenticated public timeline page
show_moderator_badge:
desc_html: Show a moderator badge on a user page
title: Show moderator badge
show_staff_badge:
desc_html: Show a staff badge on a user page
title: Show staff badge

View file

@ -645,6 +645,9 @@ ja:
show_known_fediverse_at_about_page:
desc_html: チェックを外すと、ランディングページからリンクされた公開タイムラインにローカルの公開投稿のみ表示します。
title: 公開タイムラインに連合先のコンテンツも表示する
show_moderator_badge:
desc_html: ユーザーページにモデレーターのバッジを表示します
title: モデレーターバッジを表示する
show_staff_badge:
desc_html: ユーザーページにスタッフのバッジを表示します
title: スタッフバッジを表示する

View file

@ -16,6 +16,7 @@ defaults: &defaults
min_invite_role: 'admin'
timeline_preview: true
show_staff_badge: true
show_moderator_badge: true
default_sensitive: false
hide_network: false
unfollow_modal: false