From 78557bf32256841a6422b605c576bf8d10db4fc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Tue, 3 Jul 2018 09:22:04 +0200 Subject: [PATCH] backoffice: fix attached file URLs in geojson (#24953) --- tests/test_api.py | 2 +- wcs/backoffice/management.py | 2 +- wcs/qommon/static/css/dc2/admin.css | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/test_api.py b/tests/test_api.py index 3a76f339..7e8128cc 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -1652,7 +1652,7 @@ def test_api_geojson_formdata(pub, local_user): assert field['html_value'] == "<font color="red">FOO BAR</font>" if field['label'] == 'foobar1': assert field['value'] == "test.txt" - assert field['html_value'] == '
test.txt
' + assert field['html_value'] == '
test.txt
' # check with a filter resp = get_app(pub).get(sign_uri('/api/forms/test/geojson?filter=done', user=local_user)) diff --git a/wcs/backoffice/management.py b/wcs/backoffice/management.py index c17ce743..331b4e07 100644 --- a/wcs/backoffice/management.py +++ b/wcs/backoffice/management.py @@ -84,7 +84,7 @@ def geojson_formdatas(formdatas, geoloc_key='base', fields=None): if field.type == 'map': continue html_value = formdata.get_field_view_value(field, max_length=60) - html_value = html_value.replace('[download]', formdata_backoffice_url) + html_value = html_value.replace('[download]', '%sdownload' % formdata_backoffice_url) value = formdata.get_field_view_value(field) if not html_value and not value: continue diff --git a/wcs/qommon/static/css/dc2/admin.css b/wcs/qommon/static/css/dc2/admin.css index 8aeb254f..f1187b94 100644 --- a/wcs/qommon/static/css/dc2/admin.css +++ b/wcs/qommon/static/css/dc2/admin.css @@ -1678,3 +1678,8 @@ table small, ul.user-formdatas small { display: block; } + +div.leaflet-popup-pane div.file-field img { + max-width: 100% !important; + max-height: 10vh; +} -- 2.18.0