mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-01-24 23:36:48 -06:00
Compatibility fixes for newer versions of Jinja2 (e.g. 2.9.5+). Fixes #2156
This commit is contained in:
parent
c96da34c28
commit
ec93077040
@ -518,8 +518,8 @@ function(require, $, _, S, Bootstrap, pgAdmin, Alertify, CodeMirror) {
|
||||
// First - register the menus from the other
|
||||
// modules/extensions.
|
||||
if (counter.total == counter.loaded) {
|
||||
{% for key in ('File', 'Edit', 'Object' 'Tools', 'Management', 'Help') %}{% set menu_items = current_app.menu_items['%s_items' % key.lower()] %}{% if menu_items|length > 0 %}{% set hasMenus = False %}
|
||||
obj.add_menus([{% for item in menu_items %}{% if hasMenus %},{% endif %}{
|
||||
{% for key in ('File', 'Edit', 'Object' 'Tools', 'Management', 'Help') %}
|
||||
obj.add_menus([{% for item in current_app.menu_items['%s_items' % key.lower()] %}{% if loop.index != 1 %}, {% endif %}{
|
||||
name: "{{ item.name }}",
|
||||
{% if item.module %}module: {{ item.module }},
|
||||
{% endif %}{% if item.url %}url: "{{ item.url }}",
|
||||
@ -532,7 +532,7 @@ function(require, $, _, S, Bootstrap, pgAdmin, Alertify, CodeMirror) {
|
||||
priority: {{ item.priority }},
|
||||
enable: '{{ item.enable }}'
|
||||
}{% set hasMenus = True %}{% endfor %}]);
|
||||
{% endif %}{% endfor %}
|
||||
{% endfor %}
|
||||
obj.create_menus();
|
||||
} else {
|
||||
// recall after some time
|
||||
|
@ -152,7 +152,7 @@
|
||||
}
|
||||
}{% for script in current_app.javascripts %}{% if 'deps' in script or 'exports' in script %},
|
||||
'{{ script.name }}': {
|
||||
{% if 'deps' in script %}"deps": [ {% set comma = False %}{% for dep in script['deps'] %} {% if comma %},{% else %}{% set comma = True %}{% endif %} '{{ dep }}'{% endfor %}],{% endif %}
|
||||
{% if 'deps' in script %}"deps": [{% for dep in script['deps'] %} {% if loop.index != 1 %}, {% endif %} '{{ dep }}'{% endfor %}],{% endif %}
|
||||
{% if 'exports' in script %}"exports": "{{ script['exports'] }}"{% endif %}
|
||||
}{% endif %}{% endfor %}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user