diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-09-17 20:30:05 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-09-17 20:32:39 +0200 |
commit | 7066de875f706a39d4b610daf5c9214bce40b469 (patch) | |
tree | 3774c52cdfbdc2d2ee4217ad34c486a8610d4609 /ishtar_common | |
parent | 6ea4c4f98f170b968fdbb5939875890ff8115a00 (diff) | |
download | Ishtar-7066de875f706a39d4b610daf5c9214bce40b469.tar.bz2 Ishtar-7066de875f706a39d4b610daf5c9214bce40b469.zip |
Admin: force bootstrap load of ajax_select (removed in debian package)
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/static/ajax_select/js/bootstrap.js | 30 | ||||
-rw-r--r-- | ishtar_common/templates/admin/change_form.html | 2 | ||||
-rw-r--r-- | ishtar_common/version.py | 4 |
3 files changed, 34 insertions, 2 deletions
diff --git a/ishtar_common/static/ajax_select/js/bootstrap.js b/ishtar_common/static/ajax_select/js/bootstrap.js new file mode 100644 index 000000000..cb742eaa9 --- /dev/null +++ b/ishtar_common/static/ajax_select/js/bootstrap.js @@ -0,0 +1,30 @@ +(function(w) { + /** + * load jquery and jquery-ui if needed + */ + + function not(thing) { + return typeof thing === 'undefined'; + } + + function loadJS(src) { + document.write('<script type="text/javascript" src="' + src + '"><\/script>'); + } + + function loadCSS(href) { + var script = document.createElement('link'); + script.href = href; + script.type = 'text/css'; + script.rel = 'stylesheet'; + document.head.appendChild(script); + } + + if (not(w.jQuery)) { + loadJS('//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'); + } + + if (not(w.jQuery) || not(w.jQuery.ui) || not(w.jQuery.ui.autocomplete)) { + loadJS('//code.jquery.com/ui/1.10.3/jquery-ui.js'); + loadCSS('//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css'); + } +})(window); diff --git a/ishtar_common/templates/admin/change_form.html b/ishtar_common/templates/admin/change_form.html index f5c83faa6..ea0ddd795 100644 --- a/ishtar_common/templates/admin/change_form.html +++ b/ishtar_common/templates/admin/change_form.html @@ -2,6 +2,8 @@ {% load i18n admin_urls static admin_list %} {% block extrahead %} +<script type="text/javascript" + src="{% static 'ajax_select/js/bootstrap.js'%}"></script> {{ block.super }} <style> .object-tools a.disabled:link, .object-tools a.disabled:visited, diff --git a/ishtar_common/version.py b/ishtar_common/version.py index 1d3a987a2..b183185e9 100644 --- a/ishtar_common/version.py +++ b/ishtar_common/version.py @@ -1,5 +1,5 @@ -# 3.0.11 -VERSION = (3, 0, 11) +# 3.0.12 +VERSION = (3, 0, 12) def get_version(): |