mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 04:08:41 +08:00
FEATURE: add child theme components in theme metadata.
Now theme creators can add an array of child theme components in about.json file for a top level theme.
This commit is contained in:
@ -40,6 +40,7 @@ class RemoteTheme < ActiveRecord::Base
|
||||
theme ||= Theme.new(user_id: user&.id || -1, name: theme_info["name"])
|
||||
|
||||
theme.component = theme_info["component"].to_s == "true"
|
||||
theme.child_components = theme_info["components"].presence || []
|
||||
|
||||
remote_theme = new
|
||||
remote_theme.theme = theme
|
||||
@ -63,6 +64,7 @@ class RemoteTheme < ActiveRecord::Base
|
||||
theme_info = RemoteTheme.extract_theme_info(importer)
|
||||
component = [true, "true"].include?(theme_info["component"])
|
||||
theme = Theme.new(user_id: user&.id || -1, name: theme_info["name"], component: component)
|
||||
theme.child_components = theme_info["components"].presence || []
|
||||
|
||||
remote_theme = new
|
||||
theme.remote_theme = remote_theme
|
||||
|
Reference in New Issue
Block a user