mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 03:18:09 +08:00
FEATURE: Theme settings (2) (#5611)
Allows theme authors to specify custom theme settings for the theme. Centralizes the theme/site settings into a single construct
This commit is contained in:
@ -76,6 +76,8 @@ class RemoteTheme < ActiveRecord::Base
|
||||
end
|
||||
|
||||
Theme.targets.keys.each do |target|
|
||||
next if target == :settings
|
||||
|
||||
ALLOWED_FIELDS.each do |field|
|
||||
lookup =
|
||||
if field == "scss"
|
||||
@ -91,6 +93,9 @@ class RemoteTheme < ActiveRecord::Base
|
||||
end
|
||||
end
|
||||
|
||||
settings_yaml = importer["settings.yaml"] || importer["settings.yml"]
|
||||
theme.set_field(target: :settings, name: "yaml", value: settings_yaml)
|
||||
|
||||
self.license_url ||= theme_info["license_url"]
|
||||
self.about_url ||= theme_info["about_url"]
|
||||
self.remote_updated_at = Time.zone.now
|
||||
|
Reference in New Issue
Block a user