mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-29 18:52:22 +01:00
refacto code insertion code
This commit is contained in:
parent
60c2813991
commit
f158ba2890
@ -37,7 +37,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 profile-top-badge">
|
||||
<%= PluginRegistry.code_insertions["html.user.profile"] %>
|
||||
<%= PluginRegistry.insert_code('html.user.profile') %>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
@ -63,8 +63,9 @@ module Plugin
|
||||
assets << [full_path, opts]
|
||||
end
|
||||
|
||||
def register_html_code_insertion(key, html_code)
|
||||
PluginRegistry.code_insertions[key] = html_code
|
||||
def register_code_insertion(key, code)
|
||||
PluginRegistry.code_insertions[key] ||= []
|
||||
PluginRegistry.code_insertions[key] << code
|
||||
end
|
||||
|
||||
def register_css(style) # useless ?
|
||||
|
@ -50,5 +50,9 @@ class PluginRegistry
|
||||
# elsif asset =~ /\.js\.handlebars$/
|
||||
# self.handlebars << asset
|
||||
end
|
||||
|
||||
def self.insert_code(key)
|
||||
self.code_insertions[key].join('\n')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user