From 807757110c73665b2a2be9457ef15693612ba0cd Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Sun, 11 Jun 2017 14:34:28 +0200 Subject: [PATCH] debian: use python-xstatic-select2 instead of Select2 from cloudware CDN --- debian/control | 2 +- debian/patches/01_use_xstatic_select2.diff | 44 ++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 debian/patches/01_use_xstatic_select2.diff create mode 100644 debian/patches/series diff --git a/debian/control b/debian/control index 230de50..c82f293 100644 --- a/debian/control +++ b/debian/control @@ -8,6 +8,6 @@ X-Python-Version: >= 2.7 Package: python-django-select2 Architecture: all -Depends: ${misc:Depends}, ${python:Depends}, python-django-appconf +Depends: ${misc:Depends}, ${python:Depends}, python-django-appconf, python-xstatic-select2, python-gadjo Description: Select2 option fields for Django The app includes Select2 driven Django Widgets and Form Fields. diff --git a/debian/patches/01_use_xstatic_select2.diff b/debian/patches/01_use_xstatic_select2.diff new file mode 100644 index 0000000..0e87147 --- /dev/null +++ b/debian/patches/01_use_xstatic_select2.diff @@ -0,0 +1,44 @@ +Index: django-select2/django_select2/conf.py +=================================================================== +--- django-select2.orig/django_select2/conf.py ++++ django-select2/django_select2/conf.py +@@ -5,6 +5,8 @@ from __future__ import absolute_import, + from appconf import AppConf + from django.conf import settings # NOQA + ++from gadjo.templatetags.gadjo import xstatic ++ + __all__ = ('settings', 'Select2Conf') + + +@@ -48,7 +50,7 @@ class Select2Conf(AppConf): + It has set `select2_` as a default value, which you can change if needed. + """ + +- JS = '//cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js' ++ JS = xstatic('select2', 'select2.min.js') + """ + The URI for the Select2 JS file. By default this points to the Cloudflare CDN. + +@@ -61,7 +63,7 @@ class Select2Conf(AppConf): + develop without an Internet connection. + """ + +- CSS = '//cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css' ++ CSS = xstatic('select2', 'select2.min.css') + """ + The URI for the Select2 CSS file. By default this points to the Cloudflare CDN. + +Index: django-select2/setup.py +=================================================================== +--- django-select2.orig/setup.py ++++ django-select2/setup.py +@@ -49,6 +49,8 @@ setup( + ], + install_requires=[ + 'django-appconf>=0.6.0', ++ 'XStatic-Select2', ++ 'gadjo', + ], + zip_safe=False, + ) diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..8a37337 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +01_use_xstatic_select2.diff