FEATURE: plugins can register a custom admin quick start topic that will be seeded into new sites

This commit is contained in:
Neil Lalonde
2015-06-04 15:56:17 -04:00
parent 803083fc2e
commit f1637fc11e
4 changed files with 57 additions and 3 deletions

View File

@ -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