Projet

Général

Profil

0001-backoffice-fix-attached-file-URLs-in-geojson-24953.patch

Frédéric Péters, 03 juillet 2018 09:22

Télécharger (2,42 ko)

Voir les différences:

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(-)
tests/test_api.py
1652 1652
            assert field['html_value'] == "<font color="red">FOO BAR</font>"
1653 1653
        if field['label'] == 'foobar1':
1654 1654
            assert field['value'] == "test.txt"
1655
            assert field['html_value'] == '<div class="file-field"><a download="test.txt" href="http://example.net/backoffice/management/test/28/?f=1"><span>test.txt</span></a></div>'
1655
            assert field['html_value'] == '<div class="file-field"><a download="test.txt" href="http://example.net/backoffice/management/test/28/download?f=1"><span>test.txt</span></a></div>'
1656 1656

  
1657 1657
    # check with a filter
1658 1658
    resp = get_app(pub).get(sign_uri('/api/forms/test/geojson?filter=done', user=local_user))
wcs/backoffice/management.py
84 84
                if field.type == 'map':
85 85
                    continue
86 86
                html_value = formdata.get_field_view_value(field, max_length=60)
87
                html_value = html_value.replace('[download]', formdata_backoffice_url)
87
                html_value = html_value.replace('[download]', '%sdownload' % formdata_backoffice_url)
88 88
                value = formdata.get_field_view_value(field)
89 89
                if not html_value and not value:
90 90
                    continue
wcs/qommon/static/css/dc2/admin.css
1678 1678
ul.user-formdatas small {
1679 1679
	display: block;
1680 1680
}
1681

  
1682
div.leaflet-popup-pane div.file-field img {
1683
	max-width: 100% !important;
1684
	max-height: 10vh;
1685
}
1681
-