From f2633dcc2939466943d2257439c12775fb712a11 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Mon, 1 Mar 2021 20:42:17 +0100 Subject: [PATCH] Add component for rows in details info box (#96) * add components for rows in details info box * bring back compact list style in details --- src/components/DetailsInfoRow.svelte | 15 +++ src/components/DetailsInfoRowList.svelte | 15 +++ src/components/DetailsOneRow.svelte | 5 + src/pages/DetailsPage.svelte | 114 +++++------------------ 4 files changed, 57 insertions(+), 92 deletions(-) create mode 100644 src/components/DetailsInfoRow.svelte create mode 100644 src/components/DetailsInfoRowList.svelte diff --git a/src/components/DetailsInfoRow.svelte b/src/components/DetailsInfoRow.svelte new file mode 100644 index 0000000..433edd2 --- /dev/null +++ b/src/components/DetailsInfoRow.svelte @@ -0,0 +1,15 @@ + + + + + + {title} + + diff --git a/src/components/DetailsInfoRowList.svelte b/src/components/DetailsInfoRowList.svelte new file mode 100644 index 0000000..7fcba67 --- /dev/null +++ b/src/components/DetailsInfoRowList.svelte @@ -0,0 +1,15 @@ + + + + +{#each Object.keys(items) as name} +
+ {items[name]} ({name}) +
+{/each} diff --git a/src/components/DetailsOneRow.svelte b/src/components/DetailsOneRow.svelte index cd74d93..9b3b27e 100644 --- a/src/components/DetailsOneRow.svelte +++ b/src/components/DetailsOneRow.svelte @@ -43,4 +43,9 @@ .noname{ color:#800; } + + td { + padding: 2px 8px; + font-size: 0.9em; + } diff --git a/src/pages/DetailsPage.svelte b/src/pages/DetailsPage.svelte index 7fb30b0..bbf2bf5 100644 --- a/src/pages/DetailsPage.svelte +++ b/src/pages/DetailsPage.svelte @@ -11,6 +11,8 @@ import SearchSectionDetails from '../components/SearchSectionDetails.svelte'; import DetailsOneRow from '../components/DetailsOneRow.svelte'; import DetailsLink from '../components/DetailsLink.svelte'; + import InfoRow from '../components/DetailsInfoRow.svelte'; + import InfoRowList from '../components/DetailsInfoRowList.svelte'; import Map from '../components/Map.svelte'; let aPlace; @@ -80,98 +82,35 @@
- - - - - - - - - - - - + + {aPlace.category}:{aPlace.type} + {aPlace.indexed_date} {#if (isAdminBoundary(aPlace)) } - - - - + {aPlace.admin_level} {/if} - - - - - - - - + {aPlace.rank_search} + {aPlace.rank_address} ({formatAddressRank(aPlace.rank_address)}) {#if aPlace.calculated_importance} - - - - + {/if} - - - - - - - - - - - - - - - + + {@html osmLink(aPlace)} + + {aPlace.place_id} + (on this server) + {#if aPlace.calculated_wikipedia} - - - - + {@html wikipediaLink(aPlace)} {/if} - - - - - - - - - - - - + {aPlace.calculated_postcode || ''} + +
Name - {#each Object.keys(aPlace.names) as name} -
- {aPlace.names[name]} ({name}) -
- {/each} -
Type{aPlace.category}:{aPlace.type}
Last Updated{aPlace.indexed_date}
Admin Level{aPlace.admin_level}
Search Rank{aPlace.rank_search}
Address Rank{aPlace.rank_address} ({formatAddressRank(aPlace.rank_address)})
Importance + {aPlace.calculated_importance} {#if !aPlace.importance} (estimated){/if} -
Coverage{coverageType(aPlace)}
Centre Point (lat,lon) + {coverageType(aPlace)} + {aPlace.centroid.coordinates[1]},{aPlace.centroid.coordinates[0]} -
OSM{@html osmLink(aPlace)} -
- Place Id - (on this server) - {aPlace.place_id}
Wikipedia Calculated{@html wikipediaLink(aPlace)}
Computed Postcode{aPlace.calculated_postcode || ''}
Address Tags - {#each Object.keys(aPlace.addresstags) as name} -
- {aPlace.addresstags[name]} ({name}) -
- {/each} -
Extra Tags - {#each Object.keys(aPlace.extratags) as name} -
- {aPlace.extratags[name]} ({name}) -
- {/each} -
@@ -305,15 +244,6 @@ .table { width: 100%; } - .table td { - font-size: 0.9em; - } - .table>thead>tr>th, .table>tbody>tr>td { - padding: 2px 8px; - } - .name{ - font-weight: bold; - } #map-wrapper { width:100%; min-height: auto; -- 2.43.2