mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 09:05:53 +08:00
FEATURE: Groundwork for user-selectable theme components
* Phase 0 for user-selectable theme components - Drops `key` column from the `themes` table - Drops `theme_key` column from the `user_options` table - Adds `theme_ids` (array of ints default []) column to the `user_options` table and migrates data from `theme_key` to the new column. - Removes the `default_theme_key` site setting and adds `default_theme_id` instead. - Replaces `theme_key` cookie with a new one called `theme_ids` - no longer need Theme.settings_for_client
This commit is contained in:
@ -7,7 +7,7 @@ class Admin::ThemesController < Admin::AdminController
|
||||
|
||||
def preview
|
||||
@theme = Theme.find(params[:id])
|
||||
redirect_to path("/?preview_theme_key=#{@theme.key}")
|
||||
redirect_to path("/?preview_theme_id=#{@theme.id}")
|
||||
end
|
||||
|
||||
def upload_asset
|
||||
@ -226,7 +226,7 @@ class Admin::ThemesController < Admin::AdminController
|
||||
def update_default_theme
|
||||
if theme_params.key?(:default)
|
||||
is_default = theme_params[:default].to_s == "true"
|
||||
if @theme.key == SiteSetting.default_theme_key && !is_default
|
||||
if @theme.id == SiteSetting.default_theme_id && !is_default
|
||||
Theme.clear_default!
|
||||
elsif is_default
|
||||
@theme.set_default!
|
||||
|
Reference in New Issue
Block a user