Project

General

Profile

Feature #14588

Improve extending template helpers from plugin

Added by Marek Hulán almost 5 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Plugin integration
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

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 issues

Related to Katello - Bug #14587: Previewing templates which contains subscription_manager_configuration_url helper does not workClosed2016-04-12
Related to Foreman - Bug #11403: Allowed vars and helpers are global constantsRejected2015-08-18
Related to Discovery - Feature #14595: Use the template plugin API to define helpers and attributesNew
Related to Chef - Feature #16754: Use 1.12 plugin mechanism for registering templates helpersDuplicate2016-09-30
Related to Foreman - Bug #19735: Plugin API for extending template helpers does not workNew2017-06-01
Blocks Foreman - Bug #14969: Custom status is not reloaded correctlyClosed2016-05-09

Associated revisions

Revision 32f3b017 (diff)
Added by Marek Hulán almost 5 years ago

Fixes #14588 - introduce plugin API for extending template helpers

History

#1 Updated by Marek Hulán almost 5 years ago

  • Related to Bug #14587: Previewing templates which contains subscription_manager_configuration_url helper does not work added

#2 Updated by The Foreman Bot almost 5 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3417 added

#3 Updated by Lukas Zapletal almost 5 years ago

  • Related to Bug #11403: Allowed vars and helpers are global constants added

#4 Updated by Lukas Zapletal almost 5 years ago

  • Related to Feature #14595: Use the template plugin API to define helpers and attributes added

#5 Updated by Marek Hulán almost 5 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#6 Updated by Dominic Cleal almost 5 years ago

  • Legacy Backlogs Release (now unused) set to 136

#7 Updated by Dominic Cleal over 4 years ago

  • Blocks Bug #14969: Custom status is not reloaded correctly added

#8 Updated by Marek Hulán over 4 years ago

  • Related to Feature #16754: Use 1.12 plugin mechanism for registering templates helpers added

#9 Updated by Lukas Zapletal over 3 years ago

  • Related to Bug #19735: Plugin API for extending template helpers does not work added

Also available in: Atom PDF