Merge "Fix various issues with compressed angular templates and plugins"
This commit is contained in:
commit
baae8712f8
@ -33,7 +33,6 @@ def update_angular_template_hash(sender, **kwargs):
|
|||||||
clients.
|
clients.
|
||||||
"""
|
"""
|
||||||
context = kwargs['context'] # context the compressor is working with
|
context = kwargs['context'] # context the compressor is working with
|
||||||
theme = context['THEME'] # current theme being compressed
|
|
||||||
compressed = context['compressed'] # the compressed content
|
compressed = context['compressed'] # the compressed content
|
||||||
compressed_name = compressed['name'] # name of the compressed content
|
compressed_name = compressed['name'] # name of the compressed content
|
||||||
if compressed_name == 'angular_template_cache_preloads':
|
if compressed_name == 'angular_template_cache_preloads':
|
||||||
@ -43,6 +42,7 @@ def update_angular_template_hash(sender, **kwargs):
|
|||||||
|
|
||||||
# generate the same key as used in _scripts.html when caching the
|
# generate the same key as used in _scripts.html when caching the
|
||||||
# preloads
|
# preloads
|
||||||
|
theme = context['THEME'] # current theme being compressed
|
||||||
key = make_template_fragment_key(
|
key = make_template_fragment_key(
|
||||||
"angular",
|
"angular",
|
||||||
['template_cache_preloads', theme]
|
['template_cache_preloads', theme]
|
||||||
@ -115,6 +115,9 @@ def angular_templates(context):
|
|||||||
# there will simply be no pre-loaded version for this template.
|
# there will simply be no pre-loaded version for this template.
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
templates = [(key, value) for key, value in angular_templates.items()]
|
||||||
|
templates.sort(key=lambda item: item[0])
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'angular_templates': angular_templates
|
'angular_templates': templates
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{% for static_path, template_html in angular_templates.items %}
|
{% for static_path, template_html in angular_templates %}
|
||||||
<script type='text/javascript' id='{{ static_path }}'>
|
<script type='text/javascript' id='{{ static_path }}'>
|
||||||
{% include 'angular/angular_templates.js' %}
|
{% include 'angular/angular_templates.js' %}
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user