Class: Spree::Admin::ThemeController
Instance Method Summary
collapse
#set_user_language_locale_key
Instance Method Details
#set ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'app/controllers/spree/admin/theme_controller.rb', line 8
def set
requested_theme = params[:switch_to_theme].presence
system_theme = params[:system_theme].presence == "dark" ? "dark" : "light"
session_key = :"admin_#{system_theme}_theme"
if theme_is_available?(requested_theme)
session[session_key] = requested_theme
redirect_back_or_to spree.admin_url, notice: t('spree.theme_changed')
else
redirect_back_or_to spree.admin_url, error: t('spree.error')
end
end
|