Merge pull request #646 from pvgenuchten/fix-in-concat
fixes concatenation, if int
This commit is contained in:
@@ -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 %}
|
||||
|
||||
Reference in New Issue
Block a user