Feature #14588
closed
Improve extending template helpers from plugin
Added by Marek Hulán over 8 years ago.
Updated over 6 years ago.
Category:
Plugin integration
|
Description
Currently we have two helpers available for plugin to extend allowed helpers in template rendering. Unfortunately an extra effort is required for template previewing, the concern has to be included in TemplatesController and all its children. The plugin API should do this, ideally something like
extend_template_helpers MyPlugin::Helpers
which would do following
::Foreman::Renderer.send :include, MyPlugin::Helpers
(TemplatesController.descendants + [TemplatesController]).each do |klass|
klass.send(:include, MyPlugin::Helpers)
end
it could also call allowed_template_helpers with all public methods found in MyPlugin::Helpers.
- Related to Bug #14587: Previewing templates which contains subscription_manager_configuration_url helper does not work added
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/3417 added
- Related to Bug #11403: Allowed vars and helpers are global constants added
- Related to Feature #14595: Use the template plugin API to define helpers and attributes added
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
- Translation missing: en.field_release set to 136
- Blocks Bug #14969: Custom status is not reloaded correctly added
- Related to Feature #16754: Use 1.12 plugin mechanism for registering templates helpers added
- Related to Bug #19735: Plugin API for extending template helpers does not work added
Also available in: Atom
PDF