misc: switch to leaflet packaged as xstatic (#29941)

This commit is contained in:
Frédéric Péters 2019-01-21 16:52:50 +01:00
parent 489c5124c8
commit 31323392fd
5 changed files with 7 additions and 9 deletions

4
debian/control vendored
View File

@ -2,7 +2,7 @@ Source: wcs
Section: web
Priority: optional
Maintainer: Frederic Peters <fpeters@debian.org>
Build-Depends: python-quixote, debhelper (>= 9), dh-python, dh-systemd, python-setuptools, gettext, python-gadjo, libjs-leaflet
Build-Depends: python-quixote, debhelper (>= 9), dh-python, dh-systemd, python-setuptools, gettext, python-gadjo
Standards-Version: 3.9.6.0
Homepage: https://dev.entrouvert.org/projects/wcs/
X-Python-Version: 2.7
@ -19,12 +19,12 @@ Depends: ${misc:Depends}, ${python:Depends},
python-imaging,
python-requests,
python-vobject,
python-xstatic-leaflet,
uwsgi,
uwsgi-plugin-python
Recommends: python-dns,
python-xlwt,
python-qrcode,
libjs-leaflet,
python-magic,
python-docutils,
graphicsmagick

View File

@ -109,6 +109,7 @@ setup(
install_requires=[
'gadjo>=0.53',
'django-ckeditor<4.5.3',
'XStatic-Leaflet',
],
package_dir = { 'wcs': 'wcs' },
packages = find_packages(),

View File

@ -153,8 +153,6 @@ def test_static_directories():
assert get_app(pub).get('/static/css/wcs.css')
assert get_app(pub).get('/static/images/feed-icon-10x10.png')
assert get_app(pub).get('/static/css/qommon.css')
if os.path.exists('/usr/share/javascript/leaflet/'):
assert get_app(pub).get('/static/leaflet/leaflet.js')
assert get_app(pub).get('/static/css/gadjo.css')
assert get_app(pub).get('/static/xstatic/jquery.js')
assert get_app(pub).get('/static/xstatic/jquery-ui.js')

View File

@ -69,8 +69,8 @@ class HTTPResponse(quixote.http_response.HTTPResponse):
if not mapped_script_name in self.javascript_scripts:
if script_name == 'qommon.map.js':
self.add_javascript(['jquery.js'])
self.add_javascript(['../leaflet/leaflet.js'])
self.add_css_include('../leaflet/leaflet.css')
self.add_javascript(['../xstatic/leaflet.js'])
self.add_css_include('../xstatic/leaflet.css')
self.add_javascript(['leaflet-gps.js'])
self.add_javascript(['../../i18n.js'])
if script_name == 'qommon.wysiwyg.js':

View File

@ -193,11 +193,10 @@ class RegisterDirectory(Directory):
class StaticsDirectory(Directory):
static_directories = {
# maps /leaflet/ to the directory provided by the libjs-openlayers package
'leaflet': ['/usr/share/javascript/leaflet'],
'': ['web', 'qommon', 'django:gadjo', 'django:ckeditor'],
'xstatic': ['xstatic:jquery', 'xstatic:jquery_ui',
'xstatic:font_awesome', 'xstatic:opensans'],
'xstatic:font_awesome', 'xstatic:opensans',
'xstatic:leaflet',],
}
@classmethod