prevent double loading of jQuery (#25045)

Popup dialog were broken by double loading of jQuery by gadjo/root.html
template. We override the gadjo-js block to empty it and we add the
javascript file expected by gadjo in the views default medias.
This commit is contained in:
Benjamin Dauvergne 2018-08-02 16:28:48 +02:00 committed by Emmanuel Cazenave
parent 135b81c6fc
commit 4a39fc64f2
2 changed files with 6 additions and 1 deletions

View File

@ -1,6 +1,7 @@
{% extends "gadjo/base.html" %}
{% load i18n staticfiles %}
{% block gadjo-js %}{% endblock %}
{% block bodyargs %} class="{% block bodyclasses %}{% endblock %}"{% endblock %}
{% block page-title %}{% firstof manager_site_title site_title "Authentic2" %}{% endblock %}

View File

@ -20,6 +20,8 @@ from django_tables2 import SingleTableView, SingleTableMixin
from django_select2.views import AutoResponseView
from gadjo.templatetags.gadjo import xstatic
from django_rbac.utils import get_ou_model
from authentic2.data_transfer import export_site, import_site, DataImportError, ImportContext
@ -50,7 +52,9 @@ class MediaMixin(object):
class Media:
js = (
reverse_lazy('a2-manager-javascript-catalog'),
'xstatic/jquery.js',
xstatic('jquery.js', 'jquery.min.js'),
xstatic('jquery-ui.js', 'jquery-ui.min.js'),
'js/gadjo.js',
'jquery/js/jquery.form.js',
'admin/js/urlify.js',
'authentic2/js/purl.js',