debian: use python-xstatic-select2 instead of Select2 from cloudware CDN

This commit is contained in:
Benjamin Dauvergne 2017-06-11 14:34:28 +02:00
parent f9b9d7b326
commit 807757110c
3 changed files with 46 additions and 1 deletions

2
debian/control vendored
View File

@ -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.

View File

@ -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,
)

1
debian/patches/series vendored Normal file
View File

@ -0,0 +1 @@
01_use_xstatic_select2.diff