Merge pull request #646 from pvgenuchten/fix-in-concat

fixes concatenation, if int
This commit is contained in:
Tom Kralidis
2021-02-24 08:37:10 -05:00
committed by GitHub
2 changed files with 2 additions and 2 deletions
@@ -125,7 +125,7 @@
var items = new L.GeoJSON(geojson_data, {
onEachFeature: function (feature, layer) {
var url = '{{ data['items_path'] }}/' + feature.id + '?f=html';
var html = '<span><a href="' + url + '">' + feature.id + '. ' + feature['properties']['{{ data['title_field'] }}'] + '</a></span>';
var html = '<span><a href="' + url + '">' + {% if data['title_field'] %} feature['properties']['{{ data['title_field'] }}'] {% else %} feature.id {% endif %} + '</a></span>';
layer.bindPopup(html);
}
});
@@ -1,5 +1,5 @@
{% extends "_base.html" %}
{% set ptitle = data['properties'][data['title_field']] or ("Item " + data['id']) %}
{% set ptitle = data['properties'][data['title_field']] or ("Item {}".format(data['id'])) %}
{# Optionally renders an img element, otherwise standard value or link rendering #}
{% macro render_item_value(v, width) -%}
{% set val = v | string | trim %}