2019-01-29 01:30:35 +01:00
|
|
|
<%=
|
|
|
|
result = ''
|
|
|
|
Discourse.unofficial_plugins.each do |plugin|
|
|
|
|
plugin_name = plugin.metadata.name
|
2019-11-20 13:08:04 +01:00
|
|
|
|
|
|
|
if plugin_name == 'discourse-custom-wizard' || CustomWizard::Field.require_assets[plugin_name]
|
|
|
|
|
|
|
|
files = []
|
|
|
|
|
2019-01-29 01:30:35 +01:00
|
|
|
plugin.each_globbed_asset do |f, is_dir|
|
2019-11-20 13:08:04 +01:00
|
|
|
files.push(f) if f.include? "raw.hbs"
|
|
|
|
end
|
|
|
|
|
|
|
|
Dir.glob("#{Rails.root}/app/assets/javascripts/discourse/templates/*.raw.hbs").each do |f|
|
|
|
|
files.push(f)
|
|
|
|
end
|
|
|
|
|
|
|
|
files.each do |f|
|
|
|
|
name = File.basename(f, ".raw.hbs")
|
|
|
|
compiled = Barber::Precompiler.new().compile(File.read(f))
|
|
|
|
result << "
|
|
|
|
(function() {
|
|
|
|
if ('Wizard' in window) {
|
2020-07-09 05:15:23 +02:00
|
|
|
window.__DISCOURSE_RAW_TEMPLATES['javascripts/#{name}'] = requirejs('discourse-common/lib/raw-handlebars').template(#{compiled});
|
2019-11-20 13:08:04 +01:00
|
|
|
}
|
|
|
|
})();
|
|
|
|
"
|
2019-01-29 01:30:35 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
result
|
|
|
|
%>
|