From: Sarah Hoffmann Date: Wed, 2 Dec 2020 15:29:44 +0000 (+0100) Subject: show admin level only for admin boundaries X-Git-Url: https://git.openstreetmap.org./nominatim-ui.git/commitdiff_plain/1f80258deb791946182b186b4c90b3aaec2f0d1d?ds=sidebyside show admin level only for admin boundaries --- diff --git a/dist/deletable.html b/dist/deletable.html index 1478809..16ebbc2 100644 --- a/dist/deletable.html +++ b/dist/deletable.html @@ -421,10 +421,12 @@ Last Updated {{aPlace.indexed_date}} + {{#if (isAdminBoundary aPlace) }} Admin Level {{aPlace.admin_level}} + {{/if}} Search Rank {{aPlace.rank_search}} diff --git a/dist/details.html b/dist/details.html index 1478809..16ebbc2 100644 --- a/dist/details.html +++ b/dist/details.html @@ -421,10 +421,12 @@ Last Updated {{aPlace.indexed_date}} + {{#if (isAdminBoundary aPlace) }} Admin Level {{aPlace.admin_level}} + {{/if}} Search Rank {{aPlace.rank_search}} diff --git a/dist/handlebar_helpers.js b/dist/handlebar_helpers.js index e07c339..bbb6e16 100644 --- a/dist/handlebar_helpers.js +++ b/dist/handlebar_helpers.js @@ -251,6 +251,9 @@ Handlebars.registerHelper({ if (iRank <= 30) return 'house / building'; return 'other'; }, + isAdminBoundary: function (aPlace) { + return aPlace.category === 'boundary' && aPlace.type === 'administrative'; + }, tooManyHierarchyLinesWarning: function (aPlace) { if (!aPlace.hierarchy) return ''; diff --git a/dist/polygons.html b/dist/polygons.html index 1478809..16ebbc2 100644 --- a/dist/polygons.html +++ b/dist/polygons.html @@ -421,10 +421,12 @@ Last Updated {{aPlace.indexed_date}} + {{#if (isAdminBoundary aPlace) }} Admin Level {{aPlace.admin_level}} + {{/if}} Search Rank {{aPlace.rank_search}} diff --git a/dist/reverse.html b/dist/reverse.html index 1478809..16ebbc2 100644 --- a/dist/reverse.html +++ b/dist/reverse.html @@ -421,10 +421,12 @@ Last Updated {{aPlace.indexed_date}} + {{#if (isAdminBoundary aPlace) }} Admin Level {{aPlace.admin_level}} + {{/if}} Search Rank {{aPlace.rank_search}} diff --git a/dist/search.html b/dist/search.html index 1478809..16ebbc2 100644 --- a/dist/search.html +++ b/dist/search.html @@ -421,10 +421,12 @@ Last Updated {{aPlace.indexed_date}} + {{#if (isAdminBoundary aPlace) }} Admin Level {{aPlace.admin_level}} + {{/if}} Search Rank {{aPlace.rank_search}} diff --git a/src/handlebar_helpers.js b/src/handlebar_helpers.js index e07c339..bbb6e16 100644 --- a/src/handlebar_helpers.js +++ b/src/handlebar_helpers.js @@ -251,6 +251,9 @@ Handlebars.registerHelper({ if (iRank <= 30) return 'house / building'; return 'other'; }, + isAdminBoundary: function (aPlace) { + return aPlace.category === 'boundary' && aPlace.type === 'administrative'; + }, tooManyHierarchyLinesWarning: function (aPlace) { if (!aPlace.hierarchy) return ''; diff --git a/src/templates/detailspage.hbs b/src/templates/detailspage.hbs index 410f3c8..85ad950 100644 --- a/src/templates/detailspage.hbs +++ b/src/templates/detailspage.hbs @@ -68,10 +68,12 @@ Last Updated {{aPlace.indexed_date}} + {{#if (isAdminBoundary aPlace) }} Admin Level {{aPlace.admin_level}} + {{/if}} Search Rank {{aPlace.rank_search}}