diff options
-rw-r--r-- | app/controllers/settings/preferences_controller.rb | 1 | ||||
-rw-r--r-- | app/controllers/user_webapp_css_controller.rb | 14 | ||||
-rw-r--r-- | app/lib/user_settings_decorator.rb | 5 | ||||
-rw-r--r-- | app/models/user.rb | 2 | ||||
-rw-r--r-- | app/views/settings/preferences/appearance/show.html.haml | 5 | ||||
-rw-r--r-- | config/locales/en-MP.yml | 1 | ||||
-rw-r--r-- | config/locales/simple_form.en-MP.yml | 2 |
7 files changed, 25 insertions, 5 deletions
diff --git a/app/controllers/settings/preferences_controller.rb b/app/controllers/settings/preferences_controller.rb index 189d48af6..7e42d4e40 100644 --- a/app/controllers/settings/preferences_controller.rb +++ b/app/controllers/settings/preferences_controller.rb @@ -67,6 +67,7 @@ class Settings::PreferencesController < Settings::BaseController :setting_style_css_profile, :setting_style_css_webapp, :setting_style_wide_media, + :setting_style_lowercase, :setting_publish_in, :setting_unpublish_in, :setting_unpublish_delete, diff --git a/app/controllers/user_webapp_css_controller.rb b/app/controllers/user_webapp_css_controller.rb index b2baa2843..a0a82d6c3 100644 --- a/app/controllers/user_webapp_css_controller.rb +++ b/app/controllers/user_webapp_css_controller.rb @@ -59,12 +59,24 @@ class UserWebappCssController < ApplicationController ) end + def css_lowercase + return unless @account.user&.setting_style_lowercase + + %( + div, button, span + { text-transform: lowercase; } + + code, pre + { text-transform: initial !important; } + ) + end + def css_webapp @account.user&.setting_style_css_webapp_errors.blank? ? (@account.user&.setting_style_css_webapp || '') : '' end def css - "#{css_dashed_nest}\n#{css_underline_a}\n#{css_wide_media}\n#{css_webapp}".squish + "#{css_dashed_nest}\n#{css_underline_a}\n#{css_wide_media}\n#{css_lowercase}\n#{css_webapp}".squish end def set_account diff --git a/app/lib/user_settings_decorator.rb b/app/lib/user_settings_decorator.rb index 22601ecaa..0f927d5d0 100644 --- a/app/lib/user_settings_decorator.rb +++ b/app/lib/user_settings_decorator.rb @@ -54,6 +54,7 @@ class UserSettingsDecorator user.settings['style_css_profile'] = style_css_profile_preference if change?('setting_style_css_profile') user.settings['style_css_webapp'] = style_css_webapp_preference if change?('setting_style_css_webapp') user.settings['style_wide_media'] = style_wide_media_preference if change?('setting_style_wide_media') + user.settings['style_lowercase'] = style_lowercase_preference if change?('setting_style_lowercase') user.settings['publish_in'] = publish_in_preference if change?('setting_publish_in') user.settings['unpublish_in'] = unpublish_in_preference if change?('setting_unpublish_in') user.settings['unpublish_delete'] = unpublish_delete_preference if change?('setting_unpublish_delete') @@ -209,6 +210,10 @@ class UserSettingsDecorator boolean_cast_setting 'setting_style_wide_media' end + def style_lowercase_preference + boolean_cast_setting 'setting_style_lowercase' + end + def publish_in_preference settings['setting_publish_in'].to_i end diff --git a/app/models/user.rb b/app/models/user.rb index b401e3346..89c2489b3 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -122,7 +122,7 @@ class User < ApplicationRecord :disable_swiping, :default_content_type, :system_emoji_font, :manual_publish, :style_dashed_nest, :style_underline_a, :style_css_profile, :style_css_profile_errors, :style_css_webapp, :style_css_webapp_errors, - :style_wide_media, + :style_wide_media, :style_lowercase, :publish_in, :unpublish_in, :unpublish_delete, :boost_every, :boost_jitter, :boost_random, :unpublish_on_delete, :rss_disabled, :home_reblogs, :filter_unknown, :max_history_public, :max_history_private, :web_push, diff --git a/app/views/settings/preferences/appearance/show.html.haml b/app/views/settings/preferences/appearance/show.html.haml index 13f9aa668..7658b8017 100644 --- a/app/views/settings/preferences/appearance/show.html.haml +++ b/app/views/settings/preferences/appearance/show.html.haml @@ -14,10 +14,8 @@ %h4= t 'appearance.advanced_web_interface' - %p.hint= t 'appearance.advanced_web_interface_hint' - .fields-group - = f.input :setting_advanced_layout, as: :boolean, wrapper: :with_label, hint: false + = f.input :setting_advanced_layout, as: :boolean, wrapper: :with_label, hint: t('appearance.advanced_web_interface_hint') %h4= t 'appearance.animations_and_accessibility' @@ -35,6 +33,7 @@ = f.input :setting_style_wide_media, as: :boolean, wrapper: :with_label = f.input :setting_style_dashed_nest, as: :boolean, wrapper: :with_label = f.input :setting_style_underline_a, as: :boolean, wrapper: :with_label + = f.input :setting_style_lowercase, as: :boolean, wrapper: :with_label %h4= t 'appearance.toot_layout' diff --git a/config/locales/en-MP.yml b/config/locales/en-MP.yml index 13f106552..420ae59b0 100644 --- a/config/locales/en-MP.yml +++ b/config/locales/en-MP.yml @@ -81,6 +81,7 @@ en-MP: toot_layout: Roar layout custom_css: Custom CSS custom_css_error: "There are problems with the above CSS that must be fixed before it can be applied:" + advanced_web_interface: Web interface auth: description: prefix_invited_by_user: "@%{name} invites you to join Monsterpit!" diff --git a/config/locales/simple_form.en-MP.yml b/config/locales/simple_form.en-MP.yml index 2596824d6..df9ff571a 100644 --- a/config/locales/simple_form.en-MP.yml +++ b/config/locales/simple_form.en-MP.yml @@ -33,6 +33,7 @@ en-MP: setting_max_history_private: How long followers may directly access roars from your public profile or ActivityPub outbox. Takes precedence if shorter than the public setting. setting_rss_disabled: Improves privacy by turning off your account's public RSS feed. setting_show_application: The application you use to toot will be displayed in the detailed view of your roars + setting_style_lowercase: Forces all but case-sensitive text (input fields, computer code, keycaps, etc.) to be rendered lowercase. setting_skin: Reskins the selected UI flavour setting_unpublish_on_delete: When enabled, deleting a published roar will unpublish it then make it local-only. Deleting an unpublished roar will permanently destroy it. setting_web_push: After changing this option, you will need to reload the Web interface tab or window if you have it open. @@ -70,6 +71,7 @@ en-MP: setting_style_dashed_nest: Use dashed nest level indicators setting_style_underline_a: Underline hyperlinks setting_style_wide_media: Wide media attachments + setting_style_lowercase: Lowercase mode setting_boost_every: Automatically queue and space out boosts setting_boost_jitter: Add a random delay up to setting_boost_random: Boost in random order |