1
0
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:
Nicolas Florentin 2016-05-25 12:23:25 +02:00
parent 60c2813991
commit f158ba2890
3 changed files with 8 additions and 3 deletions

View File

@ -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>

View File

@ -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 ?

View File

@ -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