Merge remote-tracking branch 'origin/better-themeing' into merging-upstream

This commit is contained in:
Ondřej Hruška
2017-09-28 09:20:59 +02:00
25 changed files with 116 additions and 52 deletions

View File

@ -12,6 +12,7 @@ class ApplicationController < ActionController::Base
helper_method :current_account
helper_method :current_session
helper_method :current_theme
helper_method :single_user_mode?
rescue_from ActionController::RoutingError, with: :not_found
@ -77,6 +78,11 @@ class ApplicationController < ActionController::Base
@current_session ||= SessionActivation.find_by(session_id: cookies.signed['_session_id'])
end
def current_theme
return Setting.default_settings['theme'] unless Themes.instance.names.include? current_user&.setting_theme
current_user.setting_theme
end
def cache_collection(raw, klass)
return raw unless klass.respond_to?(:with_includes)

View File

@ -41,6 +41,7 @@ class Settings::PreferencesController < ApplicationController
:setting_auto_play_gif,
:setting_system_font_ui,
:setting_noindex,
:setting_theme,
notification_emails: %i(follow follow_request reblog favourite mention digest),
interactions: %i(must_be_follower must_be_following)
)