]> git.openstreetmap.org Git - nominatim-ui.git/commitdiff
bring in line with API (https://github.com/openstreetmap/Nominatim/pull/968)
authormarc tobias <mtmail@gmx.net>
Thu, 5 Apr 2018 13:47:52 +0000 (15:47 +0200)
committermarc tobias <mtmail@gmx.net>
Thu, 5 Apr 2018 13:47:52 +0000 (15:47 +0200)
TODO.md
src/assets/js/detailpage.js
src/handlebar_helpers.js
src/templates/detailspage.hbs

diff --git a/TODO.md b/TODO.md
index 346e664fe2e866e92e8358919eadd14b1e42fba6..dc7578223afe67c43c96c4ef7a304b7b2f4bd5a3 100644 (file)
--- a/TODO.md
+++ b/TODO.md
@@ -43,7 +43,7 @@ http://localhost:8000/reverse.html?format=html&lat=52.3755991766591&lon=7.646484
 * add tests with fixtures
 * concatenate/minify JS and CSS
 * detailpage: make linkedplaces, childplaces optional (rarely used? second click to enable?)
-
+* set better alt tag for icons
 
 ## Code cleanup
 
index 906cd0358e6f2a27eb8e530308033e1804577ae9..299103e39567e8368bb154c899e5e5a8766bbdca 100644 (file)
@@ -58,9 +58,8 @@ jQuery(document).ready(function(){
         osmid: search_params.get('osmid'),
         keywords: search_params.get('keywords'),
         addressdetails: 1,
-        linkedplaces: 1,
-        childplaces: 1,
-        group_childplaces: 1,
+        hierarchy: 1,
+        group_hierarchy: 1,
         polygon_geojson: 1,
         format: 'json'
     };
index 722d4bb6b904af3264bcebfa37c1b04f96df4e93..89705789eabbf6c504326a79c3dd6a1753feebbf 100644 (file)
@@ -17,14 +17,14 @@ Handlebars.registerHelper({
         return ((aAddressLine.isaddress && aAddressLine.isaddress == 'f') ? 'notused' : '');
     },
     // { osm_type: 'R', osm_id: 12345 }
-    // <a href="//www.openstreetmap.org/relation/12345">relation 12345</a
+    // <a href="https://www.openstreetmap.org/relation/12345">relation 12345</a
     osmLink: function(aPlace) {
         if (!aPlace.osm_type) return '';
         var sOSMType = formatOSMType(aPlace.osm_type, false);
         if (!sOSMType) return '';
 
         return new Handlebars.SafeString(
-            '<a href="//www.openstreetmap.org/' + sOSMType + '/' + aPlace.osm_id + '">' + sOSMType + ' ' + aPlace.osm_id + '</a>'
+            '<a href="https://www.openstreetmap.org/' + sOSMType + '/' + aPlace.osm_id + '">' + sOSMType + ' ' + aPlace.osm_id + '</a>'
         );
     },
     /* en:London_Borough_of_Redbridge => https://en.wikipedia.org/wiki/London_Borough_of_Redbridge */
@@ -42,7 +42,7 @@ Handlebars.registerHelper({
         );
     },
     // { osm_type: 'R', osm_id: 12345 }
-    // <a href="//www.openstreetmap.org/relation/12345">relation 12345</a
+    // <a href="details.html?place_id=12345">details</a>
     detailsLink: function(aFeature, sTitle) {
         if (!aFeature) return '';
         if (!aFeature.place_id) return '';
@@ -80,7 +80,7 @@ Handlebars.registerHelper({
     formatMapIcon: function(sIcon) {
         if (!sIcon) return;
         
-        var url = sIcon.match(/png$/) ? Nominatim_Config.Images_Base_Url + '/' + sIcon : Nominatim_Config.Images_Base_Url + 'nominatim/images/mapicons/' + sIcon + '.n.32.png';
+        var url = Nominatim_Config.Images_Base_Url + sIcon;
 
         return new Handlebars.SafeString(
             '<img class="mapicon" src="' + url + '" alt="' + sIcon + '"/>'
@@ -100,11 +100,11 @@ Handlebars.registerHelper({
             return capitalize(aPlace.type.replace(/_/g, ' '));
         }
     },
-    tooManyParentLinesWarning: function(aPlace) {
-        if (!aPlace.parentof) return;
+    tooManyHierarchyLinesWarning: function(aPlace) {
+        if (!aPlace.hierarchy) return;
 
         var c = 0;
-        for (var type in aPlace.parentof) {
+        for (var type in aPlace.hierarchy) {
             c = c + type.length+1;
         }
         if (c < 500) return;
index 4ee9d46af7b71dc543ec7085199b38f8c9ebec9e..a725cd59b65778a0a0e471bea7dbdf05421b53e3 100644 (file)
                 {{/if}}
                 <tr>
                     <td>Computed Postcode</td>
-                    <td>{{aPlace.postcode}}</td>
+                    <td>{{aPlace.calculated_postcode}}</td>
                 </tr>
                 <tr>
                     <td>Address Tags</td>
                         {{/each}}
                     {{/if}}
 
-                    {{#if aPlace.parentof}}
+                    {{#if aPlace.hierarchy}}
                         {{> partial_h2 'Parent Of'}}
 
-                        {{#each aPlace.parentof as |lines type|}}
+                        {{#each aPlace.hierarchy as |lines type|}}
                             {{> partial_h3 type}}
                             {{#each lines}}
                                 {{> partial_details_one_row}}
                             {{/each}}
                         {{/each}}
                     {{/if}}
-                    {{tooManyParentLinesWarning aPlace}}
+                    {{tooManyHierarchyLinesWarning aPlace}}
                 </tbody>
             </table>
         </div>