diff --git a/src/fellchensammlung/templates/fellchensammlung/partials/partial-map.html b/src/fellchensammlung/templates/fellchensammlung/partials/partial-map.html index 05de0ce..b1d0c39 100644 --- a/src/fellchensammlung/templates/fellchensammlung/partials/partial-map.html +++ b/src/fellchensammlung/templates/fellchensammlung/partials/partial-map.html @@ -19,6 +19,7 @@ }).addControl(new maplibregl.NavigationControl()); {% for adoption_notice in adoption_notices %} + {% if adoption_notice.location %} // create the popup const popup_{{ forloop.counter }} = new maplibregl.Popup({offset: 25}).setHTML(`{% include "fellchensammlung/partials/partial-adoption-notice-minimal.html" %}`); @@ -33,5 +34,6 @@ .setLngLat(location_popup_{{ forloop.counter }}) .setPopup(popup_{{ forloop.counter }}) // sets a popup on this marker .addTo(map); + {% endif %} {% endfor %} diff --git a/src/fellchensammlung/templatetags/custom_tags.py b/src/fellchensammlung/templatetags/custom_tags.py index 9ad1739..d3a99df 100644 --- a/src/fellchensammlung/templatetags/custom_tags.py +++ b/src/fellchensammlung/templatetags/custom_tags.py @@ -51,4 +51,7 @@ def get_oxitraffic_script_if_enabled(): @register.filter @stringfilter def pointdecimal(value): - return f"{float(value):.9f}" + try: + return f"{float(value):.9f}" + except ValueError: + return value