]> git.openstreetmap.org Git - nominatim-ui.git/commitdiff
Details page: Use osm type and it as placeholder for unnamed places (#121)
authorYash Srivastava <52625656+darkshredder@users.noreply.github.com>
Wed, 14 Apr 2021 13:53:06 +0000 (19:23 +0530)
committerGitHub <noreply@github.com>
Wed, 14 Apr 2021 13:53:06 +0000 (15:53 +0200)
src/components/DetailsOneRow.svelte
src/pages/DetailsPage.svelte

index 7455245a2e1ce88407ae10f2b00debbd0897048a..4c439070b1012b8e7ab30bdbe722b4bb078905f6 100644 (file)
@@ -41,9 +41,6 @@
   .notused {
     color:#ddd;
   }
-  .noname{
-    color:#800;
-  }
 
   td {
     padding: 2px 8px;
index 34a7f6365bf4aede5f75d4d1fa97f76ea535ca75..9d729441e5b3ec993e0d2baf5218c957e7f28c87 100644 (file)
@@ -4,7 +4,7 @@
 
   import {
     osmLink, wikipediaLink, coverageType, isAdminBoundary,
-    formatAddressRank, formatKeywordToken
+    formatAddressRank, formatKeywordToken, formatOSMType
   } from '../lib/helpers.js';
   import Header from '../components/Header.svelte';
   import MapIcon from '../components/MapIcon.svelte';
@@ -72,7 +72,7 @@
     <div class="row">
       <div class="col-sm-10">
         <h1>
-          {aPlace.localname}
+          {aPlace.localname || `${formatOSMType(aPlace.osm_type)} ${aPlace.osm_id}` }
           <small><DetailsLink feature={aPlace}>link to this page</DetailsLink></small>
         </h1>
       </div>
       <div class="col-md-6">
         <table id="locationdetails" class="table table-striped table-responsive">
           <tbody>
-            <InfoRow title="Name"><InfoRowList items={aPlace.names} /></InfoRow>
+            <InfoRow title="Name">
+            {#if (Array.isArray(aPlace.names)) }
+              <span class="noname font-weight-bold">No Name</span>
+            {:else}
+              <InfoRowList items={aPlace.names} />
+            {/if}
+            </InfoRow>
             <InfoRow title="Type">{aPlace.category}:{aPlace.type}</InfoRow>
             <InfoRow title="Last Updated">{aPlace.indexed_date}</InfoRow>
             {#if (isAdminBoundary(aPlace)) }
     border-top: none !important;
     padding-left: 0 !important;
   }
+  :global(span.noname){
+    color:#800;
+  }
 
   #map-wrapper {
     width:100%;