Add hide someone setting
This commit is contained in:
parent
1bcf3e8c0b
commit
a85fbcd471
8 changed files with 39 additions and 6 deletions
|
@ -79,6 +79,18 @@ module HasUserSettings
|
||||||
settings['noai']
|
settings['noai']
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def setting_hide_statuses_count
|
||||||
|
settings['hide_statuses_count']
|
||||||
|
end
|
||||||
|
|
||||||
|
def setting_hide_following_count
|
||||||
|
settings['hide_following_count']
|
||||||
|
end
|
||||||
|
|
||||||
|
def setting_hide_followers_count
|
||||||
|
settings['hide_followers_count']
|
||||||
|
end
|
||||||
|
|
||||||
def setting_theme
|
def setting_theme
|
||||||
settings['theme']
|
settings['theme']
|
||||||
end
|
end
|
||||||
|
|
|
@ -12,6 +12,9 @@ class UserSettings
|
||||||
setting :theme, default: -> { ::Setting.theme }
|
setting :theme, default: -> { ::Setting.theme }
|
||||||
setting :noindex, default: -> { ::Setting.noindex }
|
setting :noindex, default: -> { ::Setting.noindex }
|
||||||
setting :noai, default: true
|
setting :noai, default: true
|
||||||
|
setting :hide_statuses_count, default: false
|
||||||
|
setting :hide_following_count, default: false
|
||||||
|
setting :hide_followers_count, default: false
|
||||||
setting :show_application, default: true
|
setting :show_application, default: true
|
||||||
setting :default_language, default: nil
|
setting :default_language, default: nil
|
||||||
setting :default_sensitive, default: false
|
setting :default_sensitive, default: false
|
||||||
|
|
|
@ -172,8 +172,7 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer
|
||||||
end
|
end
|
||||||
|
|
||||||
def other_setting
|
def other_setting
|
||||||
config = { 'noindex' => object.noindex?, 'noai' => object.noai?, 'hide_network' => object.hide_collections }
|
config = object.public_settings
|
||||||
config = config.merge(object.settings) if object.settings.present?
|
|
||||||
config.map do |k, v|
|
config.map do |k, v|
|
||||||
{
|
{
|
||||||
type: 'PropertyValue',
|
type: 'PropertyValue',
|
||||||
|
|
|
@ -157,18 +157,18 @@ class REST::AccountSerializer < ActiveModel::Serializer
|
||||||
end
|
end
|
||||||
|
|
||||||
def statuses_count
|
def statuses_count
|
||||||
object.settings.present? && object.settings['hide_statuses_count'] ? 0 : object.statuses_count
|
object.hide_statuses_count? ? 0 : object.statuses_count
|
||||||
end
|
end
|
||||||
|
|
||||||
def followers_count
|
def followers_count
|
||||||
object.settings.present? && object.settings['hide_followers_count'] ? 0 : object.followers_count
|
object.hide_followers_count? ? 0 : object.followers_count
|
||||||
end
|
end
|
||||||
|
|
||||||
def following_count
|
def following_count
|
||||||
object.settings.present? && object.settings['hide_followers_count'] ? 0 : object.following_count
|
object.hide_following_count? ? 0 : object.following_count
|
||||||
end
|
end
|
||||||
|
|
||||||
def other_settings
|
def other_settings
|
||||||
object.suspended? || object.settings.nil? ? {} : object.settings
|
object.suspended? ? {} : object.public_settings
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -49,6 +49,18 @@
|
||||||
.fields-group
|
.fields-group
|
||||||
= f.input :setting_reject_unlisted_subscription, kmyblue: true, as: :boolean, wrapper: :with_label
|
= f.input :setting_reject_unlisted_subscription, kmyblue: true, as: :boolean, wrapper: :with_label
|
||||||
|
|
||||||
|
%h4= t 'preferences.hide'
|
||||||
|
|
||||||
|
= f.simple_fields_for :settings, current_user.settings do |ff|
|
||||||
|
.fields-group
|
||||||
|
= ff.input :hide_statuses_count, as: :boolean, wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_hide_statuses_count'), hint: false
|
||||||
|
|
||||||
|
.fields-group
|
||||||
|
= ff.input :hide_following_count, as: :boolean, wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_hide_following_count'), hint: false
|
||||||
|
|
||||||
|
.fields-group
|
||||||
|
= ff.input :hide_followers_count, as: :boolean, wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_hide_followers_count'), hint: false
|
||||||
|
|
||||||
%h4= t 'preferences.public_timelines'
|
%h4= t 'preferences.public_timelines'
|
||||||
|
|
||||||
.fields-group
|
.fields-group
|
||||||
|
|
|
@ -1492,6 +1492,7 @@ ja:
|
||||||
too_few_options: は複数必要です
|
too_few_options: は複数必要です
|
||||||
too_many_options: は%{max}個までです
|
too_many_options: は%{max}個までです
|
||||||
preferences:
|
preferences:
|
||||||
|
hide: 隠蔽
|
||||||
other: その他
|
other: その他
|
||||||
posting_defaults: デフォルトの投稿設定
|
posting_defaults: デフォルトの投稿設定
|
||||||
public_timelines: 公開タイムライン
|
public_timelines: 公開タイムライン
|
||||||
|
|
|
@ -220,7 +220,10 @@ en:
|
||||||
setting_display_media_show_all: Show all
|
setting_display_media_show_all: Show all
|
||||||
setting_emoji_reaction_streaming_notify_impl2: Enable stamp notification compat with Nyastodon, Catstodon, glitch-soc
|
setting_emoji_reaction_streaming_notify_impl2: Enable stamp notification compat with Nyastodon, Catstodon, glitch-soc
|
||||||
setting_expand_spoilers: Always expand posts marked with content warnings
|
setting_expand_spoilers: Always expand posts marked with content warnings
|
||||||
|
setting_hide_followers_count: Hide followers count
|
||||||
|
setting_hide_following_count: Hide following count
|
||||||
setting_hide_network: Hide your social graph
|
setting_hide_network: Hide your social graph
|
||||||
|
setting_hide_statuses_count: Hide statuses count
|
||||||
setting_noai: Set noai meta tags
|
setting_noai: Set noai meta tags
|
||||||
setting_noindex: Opt-out of search engine indexing
|
setting_noindex: Opt-out of search engine indexing
|
||||||
setting_public_post_to_unlisted: Convert public post to public unlisted if not using Web app
|
setting_public_post_to_unlisted: Convert public post to public unlisted if not using Web app
|
||||||
|
|
|
@ -227,7 +227,10 @@ ja:
|
||||||
setting_display_media_show_all: 表示
|
setting_display_media_show_all: 表示
|
||||||
setting_emoji_reaction_streaming_notify_impl2: Nyastodon, Catstodon, glitch-soc互換のスタンプ機能を有効にする
|
setting_emoji_reaction_streaming_notify_impl2: Nyastodon, Catstodon, glitch-soc互換のスタンプ機能を有効にする
|
||||||
setting_expand_spoilers: 閲覧注意としてマークされた投稿を常に展開する
|
setting_expand_spoilers: 閲覧注意としてマークされた投稿を常に展開する
|
||||||
|
setting_hide_followers_count: フォロワー数を隠す
|
||||||
|
setting_hide_following_count: フォロー数を隠す
|
||||||
setting_hide_network: 繋がりを隠す
|
setting_hide_network: 繋がりを隠す
|
||||||
|
setting_hide_statuses_count: 投稿数を隠す
|
||||||
setting_noai: 自分のコンテンツのAI学習利用に対して不快感を表明する
|
setting_noai: 自分のコンテンツのAI学習利用に対して不快感を表明する
|
||||||
setting_noindex: 検索エンジンによるインデックスを拒否する
|
setting_noindex: 検索エンジンによるインデックスを拒否する
|
||||||
setting_public_post_to_unlisted: サードパーティアプリから投稿するとき、公開投稿をローカル公開に変更する
|
setting_public_post_to_unlisted: サードパーティアプリから投稿するとき、公開投稿をローカル公開に変更する
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue