Project

General

Profile

Actions

Feature #14588

closed

Improve extending template helpers from plugin

Added by Marek Hulán about 8 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Plugin integration
Target version:
Difficulty:
Triaged:
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 6 (1 open5 closed)

Related to Katello - Bug #14587: Previewing templates which contains subscription_manager_configuration_url helper does not workClosedMarek Hulán04/12/2016Actions
Related to Foreman - Bug #11403: Allowed vars and helpers are global constantsRejectedLukas Zapletal08/18/2015Actions
Related to Discovery - Feature #14595: Use the template plugin API to define helpers and attributesClosedDominik MatoulekActions
Related to Chef - Feature #16754: Use 1.12 plugin mechanism for registering templates helpersDuplicateMarek Hulán09/30/2016Actions
Related to Foreman - Bug #19735: Plugin API for extending template helpers does not workNew06/01/2017Actions
Blocks Foreman - Bug #14969: Custom status is not reloaded correctlyClosedMarek Hulán05/09/2016Actions
Actions

Also available in: Atom PDF