The horizon.templatetags.angular
ModuleΒΆ
-
horizon.templatetags.angular.
angular_escapes
(value)[source] Djangos ‘escapejs’ is too aggressive and inserts unicode. Provide a basic filter to allow angular template content to be used within javascript strings.
- Args:
- value: a string
- Returns:
- string with escaped values
-
horizon.templatetags.angular.
angular_templates
(context)[source] For all static HTML templates, generate a dictionary of template contents. If the template has been overridden by a theme, load the override contents instead of the original HTML file. One use for this is to pre-populate the angular template cache.
- Args:
- context: the context of the current Django template
- Returns: an object containing
- angular_templates: dictionary of angular template contents
- key is the template’s static path,
- value is a string of HTML template contents
-
horizon.templatetags.angular.
update_angular_template_hash
(sender, **kwargs)[source] Listen for compress events. If the angular templates have been re-compressed, also clear them from the Django cache backend. This is important to allow deployers to change a template file, re-compress, and not accidentally serve the old Django cached version of that content to clients.