FEATURE: allow plugins to overwrite handlebars templates

This commit is contained in:
Régis Hanol
2013-12-31 16:40:45 +01:00
parent d150bc20cf
commit 7fd88a52c9
6 changed files with 43 additions and 9 deletions

View File

@ -93,7 +93,6 @@ class Plugin::Instance
@javascripts << js
end
def register_asset(file,opts=nil)
full_path = File.dirname(path) << "/assets/" << file
assets << full_path
@ -154,10 +153,12 @@ class Plugin::Instance
end
unless assets.blank?
assets.each do |asset|
if asset =~ /\.js$|.js.erb$/
if asset =~ /\.js$|\.js\.erb$/
DiscoursePluginRegistry.javascripts << asset
elsif asset =~ /\.css$|\.scss$/
DiscoursePluginRegistry.stylesheets << asset
elsif asset =~ /\.js\.handlebars$$/
DiscoursePluginRegistry.handlebars << asset
end
end