mirror of
https://github.com/mastodon/mastodon.git
synced 2026-09-11 04:06:32 -05:00
Move theme-related helper methods out of controller (#37807)
This commit is contained in:
@@ -17,9 +17,6 @@ class ApplicationController < ActionController::Base
|
||||
|
||||
helper_method :current_account
|
||||
helper_method :current_session
|
||||
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
|
||||
@@ -173,20 +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 current_theme
|
||||
return Setting.theme unless Themes.instance.names.include? current_user&.setting_theme
|
||||
|
||||
current_user.setting_theme
|
||||
end
|
||||
|
||||
def color_scheme
|
||||
current_user&.setting_color_scheme || 'auto'
|
||||
end
|
||||
|
||||
def contrast
|
||||
current_user&.setting_contrast || 'auto'
|
||||
end
|
||||
|
||||
def respond_with_error(code)
|
||||
respond_to do |format|
|
||||
format.any { render "errors/#{code}", layout: 'error', status: code, formats: [:html] }
|
||||
|
||||
Reference in New Issue
Block a user