]> git.openstreetmap.org Git - nominatim-ui.git/commitdiff
details html page: no longer use place_id in URLs
authormarc tobias <mtmail@gmx.net>
Mon, 3 Feb 2020 23:29:28 +0000 (00:29 +0100)
committermarc tobias <mtmail@gmx.net>
Mon, 3 Feb 2020 23:29:28 +0000 (00:29 +0100)
dist/details.html
dist/detailspage.hbs
dist/handlebar_helpers.js
dist/search.html
dist/searchpage.hbs
src/handlebar_helpers.js
src/templates/detailspage.hbs
src/templates/searchpage.hbs

index d3c22a63a732c371312e3f7bedf35b44163642db..deaa97969b966d713dec873c2455a53c55732116 100644 (file)
           <td>OSM</td>
           <td>{{osmLink aPlace}}
         </tr>
           <td>OSM</td>
           <td>{{osmLink aPlace}}
         </tr>
+        <tr>
+          <td>Place Id (<a href="https://nominatim.org/release-docs/develop/api/Output/#place_id-is-not-a-persistent-id">on this server</a>)</td>
+          <td>{{aPlace.place_id}}</td>
+        </tr>
         {{#if aPlace.calculated_wikipedia}}
           <tr>
             <td>Wikipedia Calculated</td>
         {{#if aPlace.calculated_wikipedia}}
           <tr>
             <td>Wikipedia Calculated</td>
index 6fa2886efd921e142c0c763d4c4a546a25a1a4f0..67b9f8ceb3aa5bd284417f18c0e05b350eb7b368 100644 (file)
           <td>OSM</td>
           <td>{{osmLink aPlace}}
         </tr>
           <td>OSM</td>
           <td>{{osmLink aPlace}}
         </tr>
+        <tr>
+          <td>Place Id (<a href="https://nominatim.org/release-docs/develop/api/Output/#place_id-is-not-a-persistent-id">on this server</a>)</td>
+          <td>{{aPlace.place_id}}</td>
+        </tr>
         {{#if aPlace.calculated_wikipedia}}
           <tr>
             <td>Wikipedia Calculated</td>
         {{#if aPlace.calculated_wikipedia}}
           <tr>
             <td>Wikipedia Calculated</td>
index 6443d37e83c80149dbcd0502903e0b7cbd9532ce..3ef3a662f3331c9574c7a3f74fd341ab737effc5 100644 (file)
@@ -12,6 +12,12 @@ function formatOSMType(sType, bExcludeExternal) {
 }
 
 Handlebars.registerHelper({
 }
 
 Handlebars.registerHelper({
+  shortOSMType: function(sType) {
+    if (sType === 'node') return 'N';
+    if (sType === 'way') return 'W';
+    if (sType === 'relation') return 'R';
+    return '';
+  },
   isaddresses_unused: function (aAddressLine) {
     return ((aAddressLine.isaddress && aAddressLine.isaddress === 'f') ? 'notused' : '');
   },
   isaddresses_unused: function (aAddressLine) {
     return ((aAddressLine.isaddress && aAddressLine.isaddress === 'f') ? 'notused' : '');
   },
index 5b2efc1d67b902a1770384e057b445c2e721ae46..0d0b7e8ee56942faf358f9b35d7d6723977260c3 100644 (file)
     <span class="type">({{formatLabel aResult}})</span>
     <p class="coords">{{aResult.lat}},{{aResult.lon}}</p>  
 
     <span class="type">({{formatLabel aResult}})</span>
     <p class="coords">{{aResult.lat}},{{aResult.lon}}</p>  
 
-    <a class="btn btn-default btn-xs details" href="details.html?place_id={{aResult.place_id}}">details</a>
+    <a class="btn btn-default btn-xs details" href="details.html?osmtype={{shortOSMType aResult.osm_type}}&osmid={{aResult.osm_id}}">details</a>
   </div>
 {{/inline}}
 
   </div>
 {{/inline}}
 
index 40ba59be04bdfcf4bbf97aae4d695b1987014daf..ff2d88488e2f81fdbd277ef1fe3f51bbe8cb0745 100644 (file)
@@ -9,7 +9,7 @@
     <span class="type">({{formatLabel aResult}})</span>
     <p class="coords">{{aResult.lat}},{{aResult.lon}}</p>  
 
     <span class="type">({{formatLabel aResult}})</span>
     <p class="coords">{{aResult.lat}},{{aResult.lon}}</p>  
 
-    <a class="btn btn-default btn-xs details" href="details.html?place_id={{aResult.place_id}}">details</a>
+    <a class="btn btn-default btn-xs details" href="details.html?osmtype={{shortOSMType aResult.osm_type}}&osmid={{aResult.osm_id}}">details</a>
   </div>
 {{/inline}}
 
   </div>
 {{/inline}}
 
index 6443d37e83c80149dbcd0502903e0b7cbd9532ce..3ef3a662f3331c9574c7a3f74fd341ab737effc5 100644 (file)
@@ -12,6 +12,12 @@ function formatOSMType(sType, bExcludeExternal) {
 }
 
 Handlebars.registerHelper({
 }
 
 Handlebars.registerHelper({
+  shortOSMType: function(sType) {
+    if (sType === 'node') return 'N';
+    if (sType === 'way') return 'W';
+    if (sType === 'relation') return 'R';
+    return '';
+  },
   isaddresses_unused: function (aAddressLine) {
     return ((aAddressLine.isaddress && aAddressLine.isaddress === 'f') ? 'notused' : '');
   },
   isaddresses_unused: function (aAddressLine) {
     return ((aAddressLine.isaddress && aAddressLine.isaddress === 'f') ? 'notused' : '');
   },
index 6fa2886efd921e142c0c763d4c4a546a25a1a4f0..67b9f8ceb3aa5bd284417f18c0e05b350eb7b368 100644 (file)
           <td>OSM</td>
           <td>{{osmLink aPlace}}
         </tr>
           <td>OSM</td>
           <td>{{osmLink aPlace}}
         </tr>
+        <tr>
+          <td>Place Id (<a href="https://nominatim.org/release-docs/develop/api/Output/#place_id-is-not-a-persistent-id">on this server</a>)</td>
+          <td>{{aPlace.place_id}}</td>
+        </tr>
         {{#if aPlace.calculated_wikipedia}}
           <tr>
             <td>Wikipedia Calculated</td>
         {{#if aPlace.calculated_wikipedia}}
           <tr>
             <td>Wikipedia Calculated</td>
index 40ba59be04bdfcf4bbf97aae4d695b1987014daf..ff2d88488e2f81fdbd277ef1fe3f51bbe8cb0745 100644 (file)
@@ -9,7 +9,7 @@
     <span class="type">({{formatLabel aResult}})</span>
     <p class="coords">{{aResult.lat}},{{aResult.lon}}</p>  
 
     <span class="type">({{formatLabel aResult}})</span>
     <p class="coords">{{aResult.lat}},{{aResult.lon}}</p>  
 
-    <a class="btn btn-default btn-xs details" href="details.html?place_id={{aResult.place_id}}">details</a>
+    <a class="btn btn-default btn-xs details" href="details.html?osmtype={{shortOSMType aResult.osm_type}}&osmid={{aResult.osm_id}}">details</a>
   </div>
 {{/inline}}
 
   </div>
 {{/inline}}