diff options
Diffstat (limited to 'app')
-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 |
5 files changed, 22 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' |