mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:21:18 +08:00
FEATURE: plugins can register a custom admin quick start topic that will be seeded into new sites
This commit is contained in:
@ -17,6 +17,10 @@ class Plugin::Instance
|
||||
}
|
||||
end
|
||||
|
||||
def seed_data
|
||||
@seed_data ||= {}
|
||||
end
|
||||
|
||||
def self.find_all(parent_path)
|
||||
[].tap { |plugins|
|
||||
# also follows symlinks - http://stackoverflow.com/q/357754
|
||||
@ -166,7 +170,11 @@ class Plugin::Instance
|
||||
|
||||
def register_color_scheme(name, colors)
|
||||
color_schemes << {name: name, colors: colors}
|
||||
end
|
||||
end
|
||||
|
||||
def register_seed_data(key, value)
|
||||
seed_data[key] = value
|
||||
end
|
||||
|
||||
def automatic_assets
|
||||
css = styles.join("\n")
|
||||
@ -224,6 +232,10 @@ class Plugin::Instance
|
||||
|
||||
register_assets! unless assets.blank?
|
||||
|
||||
seed_data.each do |key, value|
|
||||
DiscoursePluginRegistry.register_seed_data(key, value)
|
||||
end
|
||||
|
||||
# TODO: possibly amend this to a rails engine
|
||||
|
||||
# Automatically include assets
|
||||
|
Reference in New Issue
Block a user