]> git.openstreetmap.org Git - nominatim-ui.git/blobdiff - dist/handlebar_helpers.js
details page: addressline.isaddress is a boolean, not t/f string
[nominatim-ui.git] / dist / handlebar_helpers.js
index e233eb97f5c06665ac775f533a1b22ea03fc4052..7af3384df441c4818086e8d270bf6c2555ef7aa4 100644 (file)
@@ -20,9 +20,6 @@ Handlebars.registerHelper({
     if (sType === 'relation') return 'R';
     return '';
   },
-  isaddresses_unused: function (aAddressLine) {
-    return ((aAddressLine.isaddress && aAddressLine.isaddress === 'f') ? 'notused' : '');
-  },
   // { osm_type: 'R', osm_id: 12345 }
   // <a href="https://www.openstreetmap.org/relation/12345">relation 12345</a
   osmLink: function (aPlace) {
@@ -77,6 +74,13 @@ Handlebars.registerHelper({
       '<a href="' + sURL + '">' + sTitleEscaped + '</a>'
     );
   },
+  formatPlaceType: function (aPlace) {
+    var sOut = aPlace.class + ':' + aPlace.type;
+    if (aPlace.type && aPlace.type === 'administrative' && aPlace.place_type) {
+      sOut = sOut + ' (' + aPlace.place_type + ')';
+    }
+    return new Handlebars.SafeString(sOut);
+  },
   coverageType: function (aPlace) {
     return (aPlace.isarea ? 'Polygon' : 'Point');
   },