]> git.openstreetmap.org Git - nominatim-ui.git/blobdiff - src/components/DetailsOneRow.svelte
svelte 4.x => 5.0
[nominatim-ui.git] / src / components / DetailsOneRow.svelte
index 1d63d7513be89a3f6ceed24397a48c72d9cfdd14..8ba3769b7b76188b1176485704be2e9dcd0c9a7b 100644 (file)
@@ -8,9 +8,10 @@
   export let addressLine;
   export let bDistanceInMeters;
   export let bMarkUnusedLines = false;
+  export let sCountryCode;
 
   $: bAddressLineUsed = addressLine.isaddress;
-
+  $: reverse_only = Nominatim_Config.Reverse_Only;
 </script>
 
 <tr class:notused={bMarkUnusedLines && !bAddressLineUsed}>
     {/if}
   </td>
   <td>{formatPlaceType(addressLine)}</td>
+  <!-- eslint-disable-next-line svelte/no-at-html-tags -->
   <td>{@html osmLink(addressLine)}</td>
   <td>{addressLine.rank_address}</td>
   <td>{formatAdminLevel(addressLine.admin_level)}</td>
+  <!-- eslint-disable-next-line svelte/no-at-html-tags -->
   <td>{@html formatDistance(addressLine.distance, bDistanceInMeters)}</td>
   <td>
     {#if addressLine.osm_id}
-      <DetailsLink feature={addressLine}>details</DetailsLink>
-    {:else if addressLine.type.match(/^country/)}
-      <PageLink page='search' params_hash={{ country: addressLine.localname }}>search by name</PageLink>
-    {:else if addressLine.type === 'postcode'}
-      <PageLink page='search' params_hash={{ postalcode: addressLine.localname }}>search by name</PageLink>
+      <DetailsLink feature={addressLine}>
+        details
+      </DetailsLink>
+    {:else if !reverse_only && addressLine.type.match(/^country/)}
+      <PageLink page='search' params_hash={{ country: addressLine.localname }}>
+        search by name
+      </PageLink>
+    {:else if !reverse_only && addressLine.type === 'postcode'}
+      <PageLink page='search'
+                params_hash={{ postalcode: addressLine.localname, country: sCountryCode }}>
+        search by name
+      </PageLink>
     {/if}
   </td>
 </tr>
 
 <style>
-  .notused {
-    color:#ddd;
+  .notused td {
+    color: #ccc;
   }
 
   td {