From 7bc93ff98ff4a1e890cdfe8d7f4a12071c372a7b Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Fri, 15 Jan 2021 14:35:50 -0500 Subject: [PATCH] Removed all occurances of "theme" from backend, settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Removed: - all occurances of "theme" from backend, settings Theme is set in WebSettings through client. And set in . --- .../settings/preferences_controller.rb | 1 - app/helpers/application_helper.rb | 5 ----- app/lib/settings/scoped_settings.rb | 4 +--- app/lib/user_settings_decorator.rb | 5 ----- app/models/form/admin_settings.rb | 1 - app/models/user.rb | 2 +- app/views/layouts/application.html.haml | 20 +++++++++---------- config/settings.yml | 1 - 8 files changed, 12 insertions(+), 27 deletions(-) diff --git a/app/controllers/settings/preferences_controller.rb b/app/controllers/settings/preferences_controller.rb index dbf156ed..8491ad19 100644 --- a/app/controllers/settings/preferences_controller.rb +++ b/app/controllers/settings/preferences_controller.rb @@ -44,7 +44,6 @@ class Settings::PreferencesController < Settings::BaseController :setting_display_media, :setting_expand_spoilers, :setting_noindex, - :setting_theme, :setting_hide_network, :setting_aggregate_reblogs, :setting_group_in_home_feed, diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7736d8cf..2c1b5718 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -100,11 +100,6 @@ module ApplicationHelper text.split("\n").map { |line| '> ' + line }.join("\n") end - def theme - # : todo : remove - return 'white' - end - def open_registrations? Setting.registrations_mode == 'open' end diff --git a/app/lib/settings/scoped_settings.rb b/app/lib/settings/scoped_settings.rb index 3653ab11..3a24fae0 100644 --- a/app/lib/settings/scoped_settings.rb +++ b/app/lib/settings/scoped_settings.rb @@ -2,9 +2,7 @@ module Settings class ScopedSettings - DEFAULTING_TO_UNSCOPED = %w( - theme - ).freeze + DEFAULTING_TO_UNSCOPED = %w().freeze def initialize(object) @object = object diff --git a/app/lib/user_settings_decorator.rb b/app/lib/user_settings_decorator.rb index bcbf3081..23c6d791 100644 --- a/app/lib/user_settings_decorator.rb +++ b/app/lib/user_settings_decorator.rb @@ -27,7 +27,6 @@ class UserSettingsDecorator user.settings['display_media'] = display_media_preference if change?('setting_display_media') user.settings['expand_spoilers'] = expand_spoilers_preference if change?('setting_expand_spoilers') user.settings['noindex'] = noindex_preference if change?('setting_noindex') - user.settings['theme'] = theme_preference if change?('setting_theme') user.settings['hide_network'] = hide_network_preference if change?('setting_hide_network') user.settings['aggregate_reblogs'] = aggregate_reblogs_preference if change?('setting_aggregate_reblogs') user.settings['group_in_home_feed'] = group_in_home_feed_preference if change?('setting_group_in_home_feed') @@ -81,10 +80,6 @@ class UserSettingsDecorator boolean_cast_setting 'setting_hide_network' end - def theme_preference - settings['setting_theme'] - end - def default_language_preference settings['setting_default_language'] end diff --git a/app/models/form/admin_settings.rb b/app/models/form/admin_settings.rb index a6785bb6..3421b5a9 100644 --- a/app/models/form/admin_settings.rb +++ b/app/models/form/admin_settings.rb @@ -11,7 +11,6 @@ class Form::AdminSettings site_description registrations_mode bootstrap_timeline_accounts - theme min_invite_role preview_sensitive_media thumbnail diff --git a/app/models/user.rb b/app/models/user.rb index 64ab183e..bc6c3622 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -102,7 +102,7 @@ class User < ApplicationRecord has_many :session_activations, dependent: :destroy delegate :auto_play_gif, :default_sensitive, :unfollow_modal, :boost_modal, :delete_modal, - :noindex, :theme, :display_media, :hide_network, + :noindex, :display_media, :hide_network, :expand_spoilers, :default_language, :aggregate_reblogs, :group_in_home_feed, to: :settings, prefix: :setting, allow_nil: false diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 2d93a4f7..f8aae78c 100755 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -15,16 +15,16 @@ %link{ rel: 'apple-touch-icon', sizes: '180x180', href: '/apple-touch-icon.png' }/ %link{ rel: 'mask-icon', href: '/mask-icon.svg', color: '#2B90D9' }/ - %link{ href: "splash/#{theme}/iphone5_splash.png", media: '(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)', rel: 'apple-touch-startup-image' }/ - %link{ href: "splash/#{theme}/iphone6_splash.png", media: '(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2)', rel: 'apple-touch-startup-image' }/ - %link{ href: "splash/#{theme}/iphoneplus_splash.png", media: '(device-width: 621px) and (device-height: 1104px) and (-webkit-device-pixel-ratio: 3)', rel: 'apple-touch-startup-image' }/ - %link{ href: "splash/#{theme}/iphonex_splash.png", media: '(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3)', rel: 'apple-touch-startup-image' }/ - %link{ href: "splash/#{theme}/iphonexr_splash.png", media: '(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2)', rel: 'apple-touch-startup-image' }/ - %link{ href: "splash/#{theme}/iphonexsmax_splash.png", media: '(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3)', rel: 'apple-touch-startup-image' }/ - %link{ href: "splash/#{theme}/ipad_splash.png", media: '(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2)', rel: 'apple-touch-startup-image' }/ - %link{ href: "splash/#{theme}/ipadpro1_splash.png", media: '(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2)', rel: 'apple-touch-startup-image' }/ - %link{ href: "splash/#{theme}/ipadpro3_splash.png", media: '(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2)', rel: 'apple-touch-startup-image' }/ - %link{ href: "splash/#{theme}/ipadpro2_splash.png", media: '(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2)', rel: 'apple-touch-startup-image' }/ + %link{ href: "splash/light/iphone5_splash.png", media: '(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)', rel: 'apple-touch-startup-image' }/ + %link{ href: "splash/light/iphone6_splash.png", media: '(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2)', rel: 'apple-touch-startup-image' }/ + %link{ href: "splash/light/iphoneplus_splash.png", media: '(device-width: 621px) and (device-height: 1104px) and (-webkit-device-pixel-ratio: 3)', rel: 'apple-touch-startup-image' }/ + %link{ href: "splash/light/iphonex_splash.png", media: '(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3)', rel: 'apple-touch-startup-image' }/ + %link{ href: "splash/light/iphonexr_splash.png", media: '(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2)', rel: 'apple-touch-startup-image' }/ + %link{ href: "splash/light/iphonexsmax_splash.png", media: '(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3)', rel: 'apple-touch-startup-image' }/ + %link{ href: "splash/light/ipad_splash.png", media: '(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2)', rel: 'apple-touch-startup-image' }/ + %link{ href: "splash/light/ipadpro1_splash.png", media: '(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2)', rel: 'apple-touch-startup-image' }/ + %link{ href: "splash/light/ipadpro3_splash.png", media: '(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2)', rel: 'apple-touch-startup-image' }/ + %link{ href: "splash/light/ipadpro2_splash.png", media: '(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2)', rel: 'apple-touch-startup-image' }/ %link{ rel: 'manifest', href: '/manifest.json' }/ %meta{ name: 'msapplication-config', content: '/browserconfig.xml' }/ diff --git a/config/settings.yml b/config/settings.yml index d458d876..5a46f6d9 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -20,7 +20,6 @@ defaults: &defaults preview_sensitive_media: false group_in_home_feed: true noindex: false - theme: 'default' aggregate_reblogs: true chat_messages: restrict_non_followers: true