From: Radek Czajka Date: Sat, 10 Jun 2023 18:46:13 +0000 (+0200) Subject: map X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/6f12caf7d625f0bfffd2b138897fd8c711a6b2f5?ds=sidebyside map --- diff --git a/src/references/templates/references/map.html b/src/references/templates/references/map.html index e97ccbfb7..1aadfc4c2 100644 --- a/src/references/templates/references/map.html +++ b/src/references/templates/references/map.html @@ -14,13 +14,19 @@ {% endblock %} @@ -45,7 +51,10 @@ $.get( '/pinezki/popup/' + m.target.options.mid, function(data) { - let p = L.popup({minWidth: 106}).setLatLng(m.latlng).setContent(data); + d = $(data); + n = Math.min(3, ($('a', d).length)); + w = 111 * n - 5; + let p = L.popup({minWidth: w}).setLatLng(m.latlng).setContent(data); map.openPopup(p); } ); diff --git a/src/references/templates/references/popup.html b/src/references/templates/references/popup.html index 506cb3292..170827370 100644 --- a/src/references/templates/references/popup.html +++ b/src/references/templates/references/popup.html @@ -1,7 +1,7 @@ {% load thumbnail %}

{{ entity.label }}

-
+
{% for ref in entity.reference_set.all %} {% thumbnail ref.book.cover_clean '150x150' as th %}