Project

General

Profile

Actions

Feature #14588

closed

Improve extending template helpers from plugin

Added by Marek Hulán over 8 years ago. Updated over 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 #1

Updated by Marek Hulán over 8 years ago

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

Updated by The Foreman Bot over 8 years ago

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

Updated by Lukas Zapletal over 8 years ago

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

Updated by Lukas Zapletal over 8 years ago

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

Updated by Marek Hulán over 8 years ago

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

Updated by Dominic Cleal over 8 years ago

  • Translation missing: en.field_release set to 136
Actions #7

Updated by Dominic Cleal over 8 years ago

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

Updated by Marek Hulán about 8 years ago

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

Updated by Lukas Zapletal over 7 years ago

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

Also available in: Atom PDF