]> git.openstreetmap.org Git - nominatim-ui.git/commitdiff
detailpage: add warning if too many child address lines
authorMarc Tobias Metten <mtmail@gmx.net>
Thu, 8 Mar 2018 20:59:29 +0000 (21:59 +0100)
committerMarc Tobias Metten <mtmail@gmx.net>
Thu, 8 Mar 2018 20:59:29 +0000 (21:59 +0100)
TODO.md
src/handlebar_helpers.js
src/templates/detailspage.hbs

diff --git a/TODO.md b/TODO.md
index 21073fb0427eb0de667ff54729ebb1a7703a1a48..22d3fd448346f230e3c9e3421c6f4b21eaf6694a 100644 (file)
--- a/TODO.md
+++ b/TODO.md
@@ -10,7 +10,6 @@
    * need /details to support &format=json
 * reverse: zoom not set
 http://localhost:8000/reverse.html?format=html&lat=52.3755991766591&lon=7.646484374999999&zoom=
-* details page: add "There are more child objects which are not shown" back in
 * move this TODO.txt to github issues
 * write install instructions
 * check output of /dist into repository
index f7997818c516c0ae7d407628b4735e76ff97b323..c86196660daa94ad302691076ba03ba8dd7f8459 100644 (file)
@@ -100,6 +100,19 @@ Handlebars.registerHelper({
             return capitalize(aPlace.type.replace(/_/g, ' '));
         }
     },
+    tooManyParentLinesWarning: function(aPlace) {
+        if (!aPlace.parentof_lines) return;
+
+        var c = 0;
+        for (var type in aPlace.parentof_lines) {
+            c = c + type.length+1;
+        }
+        if (c < 500) return;
+
+        return new Handlebars.SafeString(
+            '<p>There are more child objects which are not shown.</p>'
+        );
+    },
     zoomLevels: function(iSelectedZoom) {
         var aZoomLevels = [
             /*  0 */ 'Continent / Sea',
index 172539c3469442a3cecc3336fa7aea9d9adc1246..c7098b4d8edaccf568bb8ccd3a8872043604ab43 100644 (file)
                                 {{> partial_details_one_row}}
                             {{/each}}
                         {{/each}}
-                        
-        {{!--                 @if (sizeof($aParentOfLines) >= 500)
-                            <p>There are more child objects which are not shown.</p>
-                        @end --}}
-                   {{/if}}
+                    {{/if}}
+                    {{tooManyParentLinesWarning aPlace}}
                 </tbody>
             </table>
         </div>