]> git.openstreetmap.org Git - nominatim-ui.git/blobdiff - src/templates/detailspage.hbs
detailpage link only when osm_id is set
[nominatim-ui.git] / src / templates / detailspage.hbs
index 172539c3469442a3cecc3336fa7aea9d9adc1246..e0225e866ed4504c3354f9cf06f027019296ebdd 100644 (file)
 
 {{#*inline "partial_details_one_row"}}
-    <tr class="{{isaddresses_unused this}}">
-        <td class="name">
-            {{#if this.localname}}
-                {{this.localname}}
-            {{else}}
-                <span class="noname">No Name</span>
-            {{/if}}
-        </td>
-        <td>{{this.class}}:{{this.type}}</td>
-        <td>{{osmLink this}}</td>
-        <td>{{this.rank_address}}</td>
-        <td>{{formatAdminLevel this.admin_level}}</td>
-        <td>{{formatDistance this.distance}}</td>
-        <td>{{detailsLink this}}</td>
-    </tr>
+  <tr class="{{#unless bAddressLineUsed}}notused{{/unless}}">
+    <td class="name">
+      {{#if this.localname}}
+        {{this.localname}}
+      {{else}}
+        <span class="noname">No Name</span>
+      {{/if}}
+    </td>
+    <td>{{formatPlaceType this}}</td>
+    <td>{{osmLink this}}</td>
+    <td>{{this.rank_address}}</td>
+    <td>{{formatAdminLevel this.admin_level}}</td>
+    <td>{{formatDistance this.distance bDistanceInMeters}}</td>
+    <td>{{#if this.osm_id}}<a href="{{detailsURL this}}">details</a>{{/if}}</td>
+  </tr>
 {{/inline}}
 
 {{#*inline "partial_details_keyword_one_row"}}
-    <tr>
-        <td>{{formatKeywordToken this.word_token}}</td>
-        {{#if this.word_id}}
-            <td>word id: {{this.word_id}}</td>
-        {{/if}}
-    </tr>
+  <tr>
+    <td>{{formatKeywordToken this.token}}</td>
+    {{#if this.id}}
+      <td>word id: {{this.id}}</td>
+    {{/if}}
+  </tr>
 {{/inline}}
 
 
 {{#*inline "partial_h2"}}
-    <tr class="all-columns"><td colspan="6"><h2>{{this}}</h2></td></tr>
+  <tr class="all-columns"><td colspan="6"><h2>{{this}}</h2></td></tr>
 {{/inline}}
 
 {{#*inline "partial_h3"}}
-    <tr class="all-columns"><td colspan="6"><h3>{{this}}</h3></td></tr>
+  <tr class="all-columns"><td colspan="6"><h3>{{this}}</h3></td></tr>
 {{/inline}}
 
 <div class="container">
-    <div class="row">
-        <div class="col-sm-10">
-            <h1>{{aPlace.localname}}</h1>
-        </div>
-        <div class="col-sm-2 text-right">
-            {{formatMapIcon aPlace.icon}}
-        </div>
+  <div class="row">
+    <div class="col-sm-10">
+      <h1>
+        {{aPlace.localname}}
+        <small><a href="{{detailsURL aPlace}}">link to this page</a></small>
+      </h1>
+    </div>
+    <div class="col-sm-2 text-right">
+      {{formatMapIcon aPlace}}
+    </div>
+  </div>
+  <div class="row">
+    <div class="col-md-6">
+      <table id="locationdetails" class="table table-striped">
+        <tr>
+          <td>Name</td>
+          <td>
+            {{#each aPlace.names}}
+              <div class="line">
+                <span class="name">{{this}}</span> ({{@key}})
+              </div>
+            {{/each}}
+          </td>
+        </tr>
+        <tr>
+          <td>Type</td>
+          <td>{{aPlace.category}}:{{aPlace.type}}</td>
+        </tr>
+        <tr>
+          <td>Last Updated</td>
+          <td>{{aPlace.indexed_date}}</td>
+        </tr>
+        <tr>
+          <td>Admin Level</td>
+          <td>{{aPlace.admin_level}}</td>
+        </tr>
+        <tr>
+          <td>Rank</td>
+          <td>{{formatSearchRank aPlace.rank_search}}</td>
+        </tr>
+        {{#if aPlace.calculated_importance}}
+          <tr>
+            <td>Importance</td>
+            <td>
+              {{aPlace.calculated_importance}}
+              {{#unless aPlace.importance}} (estimated){{/unless}}
+            </td>
+          </tr>
+        {{/if}}
+        <tr>
+          <td>Coverage</td>
+          <td>{{coverageType aPlace}}</td>
+        </tr>
+        <tr>
+          <td>Centre Point (lat,lon)</td>
+          <td>
+            {{aPlace.centroid.coordinates.[1]}},{{aPlace.centroid.coordinates.[0]}}
+          </td>
+        </tr>
+        <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>
+            <td>{{wikipediaLink aPlace}}</td>
+          </tr>
+        {{/if}}
+        <tr>
+          <td>Computed Postcode</td>
+          <td>{{aPlace.calculated_postcode}}</td>
+        </tr>
+        <tr>
+          <td>Address Tags</td>
+          <td>
+            {{#each aPlace.addresstags}}
+              <div class="line">
+                <span class="name">{{this}}</span> ({{@key}})
+              </div>
+            {{/each}}
+          </td>
+        </tr>
+        <tr>
+          <td>Extra Tags</td>
+          <td>
+            {{#each aPlace.extratags}}
+              <div class="line">
+                <span class="name">{{this}}</span> ({{@key}})
+              </div>
+            {{/each}}
+          </td>
+        </tr>
+      </table>
     </div>
-    <div class="row">
-        <div class="col-md-6">
-            <table id="locationdetails" class="table table-striped">
-                <tr>
-                    <td>Name</td>
-                    <td>
-                        {{#each aPlace.aNames}}
-                            <div class="line"><span class="name">{{this}}</span> ({{@key}})</div>
-                        {{/each}}
-                    </td>
-                </tr>
-                <tr>
-                    <td>Type</td>
-                    <td>{{aPlace.class}}:{{aPlace.type}}</td>
-                </tr>
-                <tr>
-                    <td>Last Updated</td>
-                    <td>{{aPlace.indexed_date}}</td>
-                </tr>
-                <tr>
-                    <td>Admin Level</td>
-                    <td>{{aPlace.admin_level}}</td>
-                </tr>
-                <tr>
-                    <td>Rank</td>
-                    <td>{{aPlace.rank_search_label}}</td>
-                </tr>
-                {{#if aPlace.calculated_importance}}
-                    <tr>
-                        <td>Importance</td>
-                        <td>
-                            {{aPlace.calculated_importance}}
-                            {{#unless aPlace.importance}} (estimated){{/unless}}
-                        </td>
-                    </tr>
-                {{/if}}
-                <tr>
-                    <td>Coverage</td>
-                    <td>{{coverageType aPlace}}</td>
-                </tr>
-                <tr>
-                    <td>Centre Point</td>
-                    <td>{{aPlace.lat}},{{aPlace.lon}}</td>
-                </tr>
-                <tr>
-                    <td>OSM</td>
-                    <td>{{osmLink aPlace}}
-                </tr>
-                {{#if aPlace.wikipedia}}
-                    <tr>
-                        <td>Wikipedia Calculated</td>
-                        <td>{{wikipediaLink aPlace}}</td>
-                    </tr>
-                {{/if}}
-                <tr>
-                    <td>Computed Postcode</td>
-                    <td>{{aPlace.postcode}}</td>
-                </tr>
-                <tr>
-                    <td>Address Tags</td>
-                    <td>
-                        {{#each aPlace.aAddressTags}}
-                            <div class="line"><span class="name">{{this}}</span> ({{@key}})</div>
-                        {{/each}}
-                    </td>
-                </tr>
-                <tr>
-                    <td>Extra Tags</td>
-                    <td>
-                        {{#each aPlace.aExtraTags}}
-                            <div class="line"><span class="name">{{this}}</span> ({{@key}})</div>
-                        {{/each}}
-                    </td>
-                </tr>
-            </table>
-        </div>
-        <div class="col-md-6">
-            <div id="map"></div>
-        </div>
+    <div class="col-md-6">
+      <div id="map"></div>
     </div>
-    <div class="row">
-        <div class="col-md-12">
-            <h2>Address</h2>
-             <table id="address" class="table table-striped table-responsive">
-                <thead>
-                    <tr>
-                      <th>Local name</th>
-                      <th>Type</th>
-                      <th>OSM</th>
-                      <th>Address rank</th>
-                      <th>Admin level</th>
-                      <th>Distance</th>
-                      <th></th>
-                    </tr>
-                </thead>
-                <tbody>
-                    {{#if aPlace.address_lines}}
-                        {{#each aPlace.address_lines}}
-                            {{> partial_details_one_row}}
-                        {{/each}}
-                    {{/if}}
+  </div>
+  <div class="row">
+    <div class="col-md-12">
+      <h2>Address</h2>
+       <table id="address" class="table table-striped table-small">
+        <thead>
+          <tr>
+            <th>Local name</th>
+            <th>Type</th>
+            <th>OSM</th>
+            <th>Address rank</th>
+            <th>Admin level</th>
+            <th>Distance</th>
+            <th></th>
+          </tr>
+        </thead>
+        <tbody>
+          {{#if aPlace.address}}
+            {{#each aPlace.address}}
+              {{> partial_details_one_row bDistanceInMeters=false bAddressLineUsed=this.isaddress}}
+            {{/each}}
+          {{/if}}
 
-                    {{#if aPlace.linked_lines}}
-                        {{> partial_h2 'Linked Places'}}
-                        {{#each aPlace.linked_lines}}
-                            {{> partial_details_one_row}}
-                        {{/each}}
-                    {{/if}}
+          {{#if aPlace.linked_places}}
+            {{> partial_h2 'Linked Places'}}
+            {{#each aPlace.linked_places}}
+              {{> partial_details_one_row bDistanceInMeters=true bAddressLineUsed=true}}
+            {{/each}}
+          {{/if}}
 
-                    {{#if aPlace.place_search_name_keywords}}
-                        {{> partial_h2 'Name Keywords'}}
-                        {{#each aPlace.place_search_name_keywords}}
-                            {{> partial_details_keyword_one_row}}
-                        {{/each}}
-                    {{/if}}
+          {{#if aPlace.keywords}}
+            {{> partial_h2 'Name Keywords'}}
+            {{#each aPlace.keywords.name}}
+              {{> partial_details_keyword_one_row}}
+            {{/each}}
 
-                    {{#if aPlace.place_search_address_keywords}}
-                        {{> partial_h2 'Address Keywords'}}
-                        {{#each aPlace.place_search_address_keywords}}
-                            {{> partial_details_keyword_one_row}}
-                        {{/each}}
-                    {{/if}}
+            {{> partial_h2 'Address Keywords'}}
+            {{#each aPlace.keywords.address}}
+              {{> partial_details_keyword_one_row}}
+            {{/each}}
+          {{/if}}
 
-                    {{#if aPlace.parentof_lines}}
-                        {{> partial_h2 'Parent Of'}}
+          {{> partial_h2 'Parent Of'}}
+          {{#if aPlace.hierarchy}}
 
-                        {{#each aPlace.parentof_lines as |lines type|}}
-                            {{> partial_h3 type}}
-                            {{#each lines}}
-                                {{> partial_details_one_row}}
-                            {{/each}}
-                        {{/each}}
-                        
-        {{!--                 @if (sizeof($aParentOfLines) >= 500)
-                            <p>There are more child objects which are not shown.</p>
-                        @end --}}
-                   {{/if}}
-                </tbody>
-            </table>
-        </div>
+            {{#each aPlace.hierarchy as |lines type|}}
+              {{> partial_h3 type}}
+              {{#each lines}}
+                {{> partial_details_one_row bDistanceInMeters=true bAddressLineUsed=true}}
+              {{/each}}
+            {{/each}}
+          {{else}}
+            <tr>
+              <td>
+                <a class="btn btn-outline-secondary btn-sm"
+                  href="{{base_url}}&hierarchy=1">display child places</a>
+              </td>
+            </tr>
+          {{/if}}
+          {{tooManyHierarchyLinesWarning aPlace}}
+        </tbody>
+      </table>
     </div>
+  </div>
 </div>