mirror of
https://github.com/discourse/discourse.git
synced 2025-09-10 05:01:43 +08:00
FEATURE: plugins can register a custom admin quick start topic that will be seeded into new sites
This commit is contained in:
parent
803083fc2e
commit
f1637fc11e
4 changed files with 57 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue