]> git.openstreetmap.org Git - nominatim-ui.git/blobdiff - src/templates/detailspage.hbs
version 1.2.2
[nominatim-ui.git] / src / templates / detailspage.hbs
index a725cd59b65778a0a0e471bea7dbdf05421b53e3..783865a03dc724a806e94dec3c2ad91d5daf1818 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 this.isaddress}}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>{{detailsPermaLink this 'details >'}}</td>
+  </tr>
 {{/inline}}
 
 {{#*inline "partial_details_keyword_one_row"}}
-    <tr>
-        <td>{{formatKeywordToken this.token}}</td>
-        {{#if this.id}}
-            <td>word id: {{this.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>{{detailsPermaLink aPlace 'link to this page'}}</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.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>{{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.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="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}}
-                        {{#each aPlace.address}}
-                            {{> 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}}
+            {{/each}}
+          {{/if}}
 
-                    {{#if aPlace.linked_places}}
-                        {{> partial_h2 'Linked Places'}}
-                        {{#each aPlace.linked_places}}
-                            {{> partial_details_one_row}}
-                        {{/each}}
-                    {{/if}}
+          {{#if aPlace.linked_places}}
+            {{> partial_h2 'Linked Places'}}
+            {{#each aPlace.linked_places}}
+              {{> partial_details_one_row bDistanceInMeters=true}}
+            {{/each}}
+          {{/if}}
 
-                    {{#if aPlace.keywords}}
-                        {{> partial_h2 'Name Keywords'}}
-                        {{#each aPlace.keywords.name}}
-                            {{> partial_details_keyword_one_row}}
-                        {{/each}}
+          {{#if aPlace.keywords}}
+            {{> partial_h2 'Name Keywords'}}
+            {{#each aPlace.keywords.name}}
+              {{> partial_details_keyword_one_row}}
+            {{/each}}
 
-                        {{> partial_h2 'Address Keywords'}}
-                        {{#each aPlace.keywords.address}}
-                            {{> partial_details_keyword_one_row}}
-                        {{/each}}
-                    {{/if}}
+            {{> partial_h2 'Address Keywords'}}
+            {{#each aPlace.keywords.address}}
+              {{> partial_details_keyword_one_row}}
+            {{/each}}
+          {{/if}}
 
-                    {{#if aPlace.hierarchy}}
-                        {{> partial_h2 'Parent Of'}}
+          {{> partial_h2 'Parent Of'}}
+          {{#if aPlace.hierarchy}}
 
-                        {{#each aPlace.hierarchy as |lines type|}}
-                            {{> partial_h3 type}}
-                            {{#each lines}}
-                                {{> partial_details_one_row}}
-                            {{/each}}
-                        {{/each}}
-                    {{/if}}
-                    {{tooManyHierarchyLinesWarning aPlace}}
-                </tbody>
-            </table>
-        </div>
+            {{#each aPlace.hierarchy as |lines type|}}
+              {{> partial_h3 type}}
+              {{#each lines}}
+                {{> partial_details_one_row bDistanceInMeters=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>