mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 10:58:31 -05:00
Automatically include all .hbs
files from plugins
This commit is contained in:
parent
72efcc8e86
commit
cebb47134f
2 changed files with 9 additions and 2 deletions
|
@ -25,13 +25,20 @@ class Plugin::Instance
|
|||
@assets = []
|
||||
@color_schemes = []
|
||||
|
||||
# Automatically include all ES6 JS files
|
||||
if @path
|
||||
|
||||
# Automatically include all ES6 JS files
|
||||
dir = File.dirname(@path)
|
||||
Dir.glob("#{dir}/assets/javascripts/**/*.js.es6") do |f|
|
||||
relative = f.sub("#{dir}/assets/", "")
|
||||
register_asset(relative)
|
||||
end
|
||||
|
||||
# Automatically include all hbs files
|
||||
Dir.glob("#{dir}/assets/javascripts/**/*.hbs") do |f|
|
||||
relative = f.sub("#{dir}/assets/", "")
|
||||
register_asset(relative)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -24,7 +24,7 @@ class TrustLevel
|
|||
end
|
||||
|
||||
def valid?(level)
|
||||
valid_range === level
|
||||
valid_range === level
|
||||
end
|
||||
|
||||
def valid_range
|
||||
|
|
Loading…
Reference in a new issue