X-Git-Url: https://git.openstreetmap.org./nominatim-ui.git/blobdiff_plain/04224d9aa3b35e5adc455fde1cc081cf3d4c94bd..302bbba7cfc04b0bc90fff9279c587545a9816c4:/src/handlebar_helpers.js diff --git a/src/handlebar_helpers.js b/src/handlebar_helpers.js index 3ef3a66..358ac36 100644 --- a/src/handlebar_helpers.js +++ b/src/handlebar_helpers.js @@ -66,8 +66,13 @@ Handlebars.registerHelper({ var sTitleEscaped = Handlebars.escapeExpression(sTitle || sOSMType + ' ' + aFeature.osm_id); + var sURL = 'details.html?osmtype=' + aFeature.osm_type + '&osmid=' + aFeature.osm_id; + if (aFeature.category) { + sURL = sURL + '&class=' + aFeature.category; + } + return new Handlebars.SafeString( - '' + sTitleEscaped + '' + '' + sTitleEscaped + '' ); }, coverageType: function (aPlace) { @@ -110,10 +115,12 @@ Handlebars.registerHelper({ return s && s[0].toUpperCase() + s.slice(1); } - if (aPlace.type && aPlace.type === 'yes') { + if (aPlace.type && aPlace.type === 'yes' && aPlace.class) { return capitalize(aPlace.class.replace(/_/g, ' ')); + } else if (aPlace.type) { + return capitalize(aPlace.type.replace(/_/g, ' ')); } - return capitalize(aPlace.type.replace(/_/g, ' ')); + return ''; }, formatSearchRank: function (iRank) { // same as