diff --git a/app/controllers/settings/privacy_extra_controller.rb b/app/controllers/settings/privacy_extra_controller.rb new file mode 100644 index 0000000000..54cedf2c4b --- /dev/null +++ b/app/controllers/settings/privacy_extra_controller.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class Settings::PrivacyExtraController < Settings::BaseController + before_action :set_account + + def show; end + + def update + if UpdateAccountService.new.call(@account, account_params.except(:settings)) + current_user.update!(settings_attributes: account_params[:settings]) + ActivityPub::UpdateDistributionWorker.perform_async(@account.id) + redirect_to settings_privacy_extra_path, notice: I18n.t('generic.changes_saved_msg') + else + render :show + end + end + + private + + def account_params + params.require(:account).permit(settings: UserSettings.keys) + end + + def set_account + @account = current_account + end +end diff --git a/app/views/settings/preferences/other/show.html.haml b/app/views/settings/preferences/other/show.html.haml index a66d8cc6f6..7bdce84c23 100644 --- a/app/views/settings/preferences/other/show.html.haml +++ b/app/views/settings/preferences/other/show.html.haml @@ -11,15 +11,6 @@ .fields-group = ff.input :aggregate_reblogs, wrapper: :with_label, recommended: true, label: I18n.t('simple_form.labels.defaults.setting_aggregate_reblogs'), hint: I18n.t('simple_form.hints.defaults.setting_aggregate_reblogs') - .fields-group - = ff.input :noai, wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_noai'), hint: I18n.t('simple_form.hints.defaults.setting_noai') - - .fields-group - = ff.input :translatable_private, wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_translatable_private') - - .fields-group - = ff.input :link_preview, wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_link_preview') - %h4= t 'preferences.posting_defaults' .fields-row @@ -40,16 +31,16 @@ = ff.input :stay_privacy, wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_stay_privacy') .fields-group - = ff.input :'web.enable_login_privacy', wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_enable_login_privacy'), hint: false + = ff.input :public_post_to_unlisted, wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_public_post_to_unlisted'), hint: I18n.t('simple_form.hints.defaults.setting_public_post_to_unlisted') .fields-group = ff.input :disallow_unlisted_public_searchability, wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_disallow_unlisted_public_searchability'), hint: I18n.t('simple_form.hints.defaults.setting_disallow_unlisted_public_searchability') .fields-group - = ff.input :public_post_to_unlisted, wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_public_post_to_unlisted'), hint: I18n.t('simple_form.hints.defaults.setting_public_post_to_unlisted') + = ff.input :default_sensitive, wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_default_sensitive'), hint: I18n.t('simple_form.hints.defaults.setting_default_sensitive') .fields-group - = ff.input :default_sensitive, wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_default_sensitive'), hint: I18n.t('simple_form.hints.defaults.setting_default_sensitive') + = ff.input :'web.enable_login_privacy', wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_enable_login_privacy'), hint: false %h4= t 'preferences.public_timelines' diff --git a/app/views/settings/privacy/show.html.haml b/app/views/settings/privacy/show.html.haml index 0bed511a8c..619429392e 100644 --- a/app/views/settings/privacy/show.html.haml +++ b/app/views/settings/privacy/show.html.haml @@ -21,6 +21,9 @@ .fields-group = ff.input :discoverable_local, wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.discoverable_local'), hint: I18n.t('simple_form.hints.defaults.discoverable_local') + .fields-group + = ff.input :noai, wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_noai'), hint: I18n.t('simple_form.hints.defaults.setting_noai') + .fields-group = f.input :dissubscribable, as: :boolean, wrapper: :with_label, kmyblue: true, hint: t('simple_form.hints.defaults.dissubscribable') @@ -54,15 +57,5 @@ .fields-group = ff.input :show_application, wrapper: :with_label - %h4= t 'privacy.stop_deliver' - - %p.lead= t('privacy.stop_deliver_hint_html') - - .fields-group - = ff.input :reject_public_unlisted_subscription, kmyblue: true, as: :boolean, wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_reject_public_unlisted_subscription') - - .fields-group - = ff.input :reject_unlisted_subscription, kmyblue: true, as: :boolean, wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_reject_unlisted_subscription'), hint: I18n.t('simple_form.hints.defaults.setting_reject_unlisted_subscription') - .actions = f.button :button, t('generic.save_changes'), type: :submit diff --git a/app/views/settings/privacy_extra/show.html.haml b/app/views/settings/privacy_extra/show.html.haml new file mode 100644 index 0000000000..53c11f9cdd --- /dev/null +++ b/app/views/settings/privacy_extra/show.html.haml @@ -0,0 +1,36 @@ +- content_for :page_title do + = t('privacy_extra.title') + +- content_for :heading do + %h2= t('settings.profile') + = render partial: 'settings/shared/profile_navigation' + += simple_form_for @account, url: settings_privacy_extra_path, html: { method: :put } do |f| + = render 'shared/error_messages', object: @account + + %p.lead= t('privacy_extra.hint_html') + + %h4= t('privacy_extra.post_processing') + + %p.lead= t('privacy_extra.post_processing_hint_html') + + = f.simple_fields_for :settings, current_user.settings do |ff| + .fields-group + = ff.input :translatable_private, wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_translatable_private') + + .fields-group + = ff.input :link_preview, wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_link_preview') + + %h4= t 'privacy_extra.stop_deliver' + + %p.lead= t('privacy_extra.stop_deliver_hint_html') + + = f.simple_fields_for :settings, current_user.settings do |ff| + .fields-group + = ff.input :reject_public_unlisted_subscription, kmyblue: true, as: :boolean, wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_reject_public_unlisted_subscription') + + .fields-group + = ff.input :reject_unlisted_subscription, kmyblue: true, as: :boolean, wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_reject_unlisted_subscription'), hint: I18n.t('simple_form.hints.defaults.setting_reject_unlisted_subscription') + + .actions + = f.button :button, t('generic.save_changes'), type: :submit diff --git a/app/views/settings/shared/_profile_navigation.html.haml b/app/views/settings/shared/_profile_navigation.html.haml index 3a657c5bde..fb7e80e023 100644 --- a/app/views/settings/shared/_profile_navigation.html.haml +++ b/app/views/settings/shared/_profile_navigation.html.haml @@ -3,5 +3,6 @@ :ruby primary.item :profile, safe_join([fa_icon('user fw'), t('settings.edit_profile')]), settings_profile_path primary.item :privacy, safe_join([fa_icon('lock fw'), t('privacy.title')]), settings_privacy_path + primary.item :privacy_extra, safe_join([fa_icon('lock fw'), t('privacy_extra.title')]), settings_privacy_extra_path primary.item :verification, safe_join([fa_icon('check fw'), t('verification.verification')]), settings_verification_path primary.item :featured_tags, safe_join([fa_icon('hashtag fw'), t('settings.featured_tags')]), settings_featured_tags_path diff --git a/config/locales/en.yml b/config/locales/en.yml index 7a6b70371d..9ac7bce983 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1619,6 +1619,13 @@ en: search_hint_html: Control how you want to be found. Do you want people to find you by what you've publicly posted about? Do you want people outside Mastodon to find your profile when searching the web? Please mind that total exclusion from all search engines cannot be guaranteed for public information. stop_deliver: Stop delivering title: Privacy and reach + privacy_extra: + hint_html: These settings are kmyblue original. You will receive additional privacy benefits by doing this setting. + post_processing_hint_html: 投稿された情報に対して、システムが追加で行うことができる操作を制御します。これらには、第三者のサイトへあなたの投稿に関する情報の送信を伴う設定も含まれます。 + post_processing: 投稿の処理 + stop_deliver: 配送停止 + stop_deliver_hint_html: Mastodonの投稿を、他のソフトウェアでは自由に検索することができます。Mastodon内で行ったプライバシーの設定は無視され、あなたの投稿が意図しない人に見つかるおそれがあります。ここでは、他のサーバーやソフトウェアであなたの投稿が見つからないようにする設定が可能です。ただしリスクは伴います。 + title: Privacy extra settings privacy_policy: title: Privacy Policy reactions: diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 1962d9af0d..3a88918add 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -1592,9 +1592,14 @@ ja: reach_hint_html: Control whether you want to be discovered and followed by new people. Do you want your posts to appear on the Explore screen? Do you want other people to see you in their follow recommendations? Do you want to accept all new followers automatically, or have granular control over each one? search: Search search_hint_html: Control how you want to be found. Do you want people to find you by what you've publicly posted about? Do you want people outside Mastodon to find your profile when searching the web? Please mind that total exclusion from all search engines cannot be guaranteed for public information. + title: Privacy and reach + privacy_extra: + hint_html: これらはkmyblue独自のプライバシー設定項目です。この機能を利用することで、あなたは追加の恩恵を受けることができます。なおこれらの設定の一部は他のサーバーにも送信されますが、kmyblue以外で対応が確認されているソフトウェアは現在確認できていません。他のサーバーではこれらの設定は無視されること、ご了承ください。 + post_processing_hint_html: 投稿された情報に対して、システムが追加で行うことができる操作を制御します。これらには、第三者のサイトへあなたの投稿に関する情報の送信を伴う設定も含まれます。 + post_processing: 投稿の処理 stop_deliver: 配送停止 stop_deliver_hint_html: Mastodonの投稿を、他のソフトウェアでは自由に検索することができます。Mastodon内で行ったプライバシーの設定は無視され、あなたの投稿が意図しない人に見つかるおそれがあります。ここでは、他のサーバーやソフトウェアであなたの投稿が見つからないようにする設定が可能です。ただしリスクは伴います。 - title: Privacy and reach + title: プライバシー追加設定 privacy_policy: title: プライバシーポリシー reactions: diff --git a/config/routes/settings.rb b/config/routes/settings.rb index 888fa9ecb5..64c7a5eb5b 100644 --- a/config/routes/settings.rb +++ b/config/routes/settings.rb @@ -62,6 +62,7 @@ namespace :settings do resource :migration, only: [:show, :create] resource :verification, only: :show resource :privacy, only: [:show, :update], controller: 'privacy' + resource :privacy_extra, only: [:show, :update], controller: 'privacy_extra' namespace :migration do resource :redirect, only: [:new, :create, :destroy]