Merge commit 'd13d7b4566d551d027830f7dfc987ba3a8e2dd4f' into glitch-soc/merge-upstream
Conflicts are too numerous to list, but they are all caused by upstream's theming changes and all have to do with the differences between upstream and glitch-soc in the theming systems. They were all manually resolved by adapting the relevant code.
This commit is contained in:
commit
4fbd1ad7ae
41 files changed
+372
-243
No files matched your search
@@ -11,18 +11,12 @@ class ApplicationController < ActionController::Base
|
||||
include CacheConcern
|
||||
include PreloadingConcern
|
||||
include DomainControlHelper
|
||||
include ThemingConcern
|
||||
include DatabaseHelper
|
||||
include AuthorizedFetchHelper
|
||||
include SelfDestructHelper
|
||||
|
||||
helper_method :current_account
|
||||
helper_method :current_session
|
||||
helper_method :current_flavour
|
||||
helper_method :current_skin
|
||||
helper_method :current_theme
|
||||
helper_method :color_scheme
|
||||
helper_method :contrast
|
||||
helper_method :single_user_mode?
|
||||
helper_method :use_seamless_external_login?
|
||||
helper_method :sso_account_settings
|
||||
@@ -176,25 +170,6 @@ class ApplicationController < ActionController::Base
|
||||
@current_session = SessionActivation.find_by(session_id: cookies.signed['_session_id']) if cookies.signed['_session_id'].present?
|
||||
end
|
||||
|
||||
def color_scheme
|
||||
current = current_user&.setting_color_scheme
|
||||
return current if current && current != 'auto'
|
||||
|
||||
return 'dark' if current_skin.include?('default') || current_skin.include?('contrast')
|
||||
return 'light' if current_skin.include?('light')
|
||||
|
||||
'auto'
|
||||
end
|
||||
|
||||
def contrast
|
||||
current = current_user&.setting_contrast
|
||||
return current if current && current != 'auto'
|
||||
|
||||
return 'high' if current_skin.include?('contrast')
|
||||
|
||||
'auto'
|
||||
end
|
||||
|
||||
def respond_with_error(code)
|
||||
respond_to do |format|
|
||||
format.any { render "errors/#{code}", layout: 'error', status: code, formats: [:html] }
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ThemingConcern
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
private
|
||||
|
||||
def current_flavour
|
||||
@current_flavour ||= [current_user&.setting_flavour, Setting.flavour, 'glitch', 'vanilla'].find { |flavour| Themes.instance.flavours.include?(flavour) }
|
||||
end
|
||||
|
||||
def current_skin
|
||||
@current_skin ||= begin
|
||||
skins = Themes.instance.skins_for(current_flavour)
|
||||
[current_user&.setting_skin, Setting.skin, 'system', 'default'].find { |skin| skins.include?(skin) }
|
||||
end
|
||||
end
|
||||
|
||||
def current_theme
|
||||
# NOTE: this is slightly different from upstream, as it's a derived value used
|
||||
# for the sole purpose of pointing to the appropriate stylesheet pack
|
||||
[current_flavour, current_skin]
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user