Anxiety reduction: add option to hide mascot.

staging
multiple creatures 2019-05-04 19:25:58 -05:00
parent 545330dc65
commit 992218f05f
6 changed files with 18 additions and 1 deletions

View File

@ -47,6 +47,7 @@ class Settings::PreferencesController < Settings::BaseController
:setting_hide_mntions_packm8,
:setting_gently_kobolds,
:setting_user_is_kobold,
:setting_hide_mascot,
:setting_default_privacy,
:setting_default_sensitive,

View File

@ -32,8 +32,9 @@ class UserSettingsDecorator
user.settings['hide_mntions_packm8'] = hide_mntions_packm8_preference if change?('setting_hide_mntions_packm8')
user.settings['gently_kobolds'] = gently_kobolds_preference if change?('setting_gently_kobolds')
user.settings['user_is_kobold'] = user_is_kobold_preference if change?('setting_user_is_kobold')
user.settings['hide_captions'] = hide_captions_preference if change?('setting_hide_captions')
user.settings['hide_mascot'] = hide_mascot_preference if change?('setting_hide_mascot')
user.settings['notification_emails'] = merged_notification_emails if change?('notification_emails')
user.settings['interactions'] = merged_interactions if change?('interactions')
user.settings['default_privacy'] = default_privacy_preference if change?('setting_default_privacy')
@ -110,6 +111,10 @@ class UserSettingsDecorator
boolean_cast_setting 'setting_user_is_kobold'
end
def hide_mascot_preference
boolean_cast_setting 'setting_hide_mascot'
end
def merged_notification_emails
user.settings['notification_emails'].merge coerced_settings('notification_emails').to_h
end

View File

@ -121,6 +121,7 @@ class User < ApplicationRecord
:hide_mntions_packm8,
:gently_kobolds,
:user_is_kobold,
:hide_mascot,
:auto_play_gif,
:default_sensitive,
@ -275,6 +276,10 @@ class User < ApplicationRecord
settings.user_is_kobold || false
end
def setting_hide_mascot
settings.hide_mascot || false
end
def setting_default_privacy
settings.default_privacy || 'public'
end

View File

@ -81,5 +81,9 @@
:css
.status__wrapper--filtered { display: none !important; }
- if current_account&.user&.setting_hide_mascot
:css
.drawer__inner__mastodon>img { display: none !important }
%body{ class: body_classes }
= content_for?(:content) ? yield(:content) : yield

View File

@ -63,6 +63,7 @@
= f.input :setting_larger_drawer, as: :boolean, wrapper: :with_label
.fields-group
= f.input :setting_hide_mascot, as: :boolean, wrapper: :with_label
= f.input :setting_remove_filtered, as: :boolean, wrapper: :with_label
= f.input :setting_hide_replies_muted, as: :boolean, wrapper: :with_label
= f.input :setting_hide_replies_blocked, as: :boolean, wrapper: :with_label

View File

@ -126,6 +126,7 @@ en:
setting_hide_mntions_packm8: Filter group chat branches addressed to participants you aren't a packmate of
setting_gently_kobolds: Gently the kobolds
setting_user_is_kobold: I am a kobold
setting_hide_mascot: Don't show the mascot image
setting_aggregate_reblogs: Group repeats in timelines
setting_auto_play_gif: Auto-play animated GIFs
setting_boost_modal: Show confirmation dialog before repeating