]> 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 783865a03dc724a806e94dec3c2ad91d5daf1818..e0225e866ed4504c3354f9cf06f027019296ebdd 100644 (file)
@@ -1,6 +1,6 @@
 
 {{#*inline "partial_details_one_row"}}
 
 {{#*inline "partial_details_one_row"}}
-  <tr class="{{#unless this.isaddress}}notused{{/unless}}">
+  <tr class="{{#unless bAddressLineUsed}}notused{{/unless}}">
     <td class="name">
       {{#if this.localname}}
         {{this.localname}}
     <td class="name">
       {{#if this.localname}}
         {{this.localname}}
@@ -13,7 +13,7 @@
     <td>{{this.rank_address}}</td>
     <td>{{formatAdminLevel this.admin_level}}</td>
     <td>{{formatDistance this.distance bDistanceInMeters}}</td>
     <td>{{this.rank_address}}</td>
     <td>{{formatAdminLevel this.admin_level}}</td>
     <td>{{formatDistance this.distance bDistanceInMeters}}</td>
-    <td>{{detailsPermaLink this 'details >'}}</td>
+    <td>{{#if this.osm_id}}<a href="{{detailsURL this}}">details</a>{{/if}}</td>
   </tr>
 {{/inline}}
 
   </tr>
 {{/inline}}
 
@@ -40,7 +40,7 @@
     <div class="col-sm-10">
       <h1>
         {{aPlace.localname}}
     <div class="col-sm-10">
       <h1>
         {{aPlace.localname}}
-        <small>{{detailsPermaLink aPlace 'link to this page'}}</small>
+        <small><a href="{{detailsURL aPlace}}">link to this page</a></small>
       </h1>
     </div>
     <div class="col-sm-2 text-right">
       </h1>
     </div>
     <div class="col-sm-2 text-right">
         <tbody>
           {{#if aPlace.address}}
             {{#each aPlace.address}}
         <tbody>
           {{#if aPlace.address}}
             {{#each aPlace.address}}
-              {{> partial_details_one_row bDistanceInMeters=false}}
+              {{> partial_details_one_row bDistanceInMeters=false bAddressLineUsed=this.isaddress}}
             {{/each}}
           {{/if}}
 
           {{#if aPlace.linked_places}}
             {{> partial_h2 'Linked Places'}}
             {{#each aPlace.linked_places}}
             {{/each}}
           {{/if}}
 
           {{#if aPlace.linked_places}}
             {{> partial_h2 'Linked Places'}}
             {{#each aPlace.linked_places}}
-              {{> partial_details_one_row bDistanceInMeters=true}}
+              {{> partial_details_one_row bDistanceInMeters=true bAddressLineUsed=true}}
             {{/each}}
           {{/if}}
 
             {{/each}}
           {{/if}}
 
             {{#each aPlace.hierarchy as |lines type|}}
               {{> partial_h3 type}}
               {{#each lines}}
             {{#each aPlace.hierarchy as |lines type|}}
               {{> partial_h3 type}}
               {{#each lines}}
-                {{> partial_details_one_row bDistanceInMeters=true}}
+                {{> partial_details_one_row bDistanceInMeters=true bAddressLineUsed=true}}
               {{/each}}
             {{/each}}
           {{else}}
               {{/each}}
             {{/each}}
           {{else}}