]> git.openstreetmap.org Git - nominatim-ui.git/blobdiff - src/handlebar_helpers.js
Nominatim github organization name changed. Add github link for this frontend as...
[nominatim-ui.git] / src / handlebar_helpers.js
index e233eb97f5c06665ac775f533a1b22ea03fc4052..c7dca541ede8d196945b21d517b854cc84bf39c8 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');
   },
@@ -127,7 +131,7 @@ Handlebars.registerHelper({
   },
   formatSearchRank: function (iRank) {
     // same as
-    // https://github.com/openstreetmap/Nominatim/blob/master/sql/functions.sql
+    // https://github.com/osm-search/Nominatim/blob/master/sql/functions.sql
     // get_searchrank_label()
 
     if (iRank < 2) return 'continent';