From: mtmail Date: Tue, 16 Feb 2021 21:17:11 +0000 (+0100) Subject: put search,reverse,by-id links into top navbar (#75) X-Git-Url: https://git.openstreetmap.org./nominatim-ui.git/commitdiff_plain/c061d3fd3d4c9135fdbda0af273d9fc0dc5b5535 put search,reverse,by-id links into top navbar (#75) --- diff --git a/src/App.svelte b/src/App.svelte index ec1ca0b..d120173 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -4,7 +4,6 @@ import { page, refresh_page } from './lib/stores.js'; - import Header from './components/Header.svelte'; import Footer from './components/Footer.svelte'; import ReportIssueModal from './components/ReportIssueModal.svelte'; import SearchPage from './pages/SearchPage.svelte'; @@ -21,7 +20,6 @@ refresh_page()} /> -
{#if view === 'search'} {:else if view === 'reverse'} diff --git a/src/components/DetailsIndex.svelte b/src/components/DetailsIndex.svelte deleted file mode 100644 index 2183597..0000000 --- a/src/components/DetailsIndex.svelte +++ /dev/null @@ -1,94 +0,0 @@ - -
-
-
- -

Show details for place

- -
-

Search by place id

- -
- - -
-
- -
-

Search by OSM type and OSM id

- -
- - - - -
-
- -
-

Search by openstreetmap.org URL

- -
- - - - -
-
- -
-
-
- - diff --git a/src/components/Header.svelte b/src/components/Header.svelte index 5000cd6..d38c87c 100644 --- a/src/components/Header.svelte +++ b/src/components/Header.svelte @@ -1,68 +1,85 @@ + import ReverseLink from './ReverseLink.svelte'; + import LastUpdated from './LastUpdated.svelte'; -
-
-
-
- - logo -

Nominatim

-
-
-
-
- +
+
+ +
+ diff --git a/src/components/LastUpdated.svelte b/src/components/LastUpdated.svelte index f269903..ccf1338 100644 --- a/src/components/LastUpdated.svelte +++ b/src/components/LastUpdated.svelte @@ -15,9 +15,8 @@ -
-
loading...
- {#if last_updated_date} - {#if last_api_request_url} -
- Data from API request - - (debug output) - -
- {/if} - Data last updated: {last_updated_date} - {/if} +
+
+
+
loading...
+ {#if last_api_request_url} +
+ Data from API request + + (debug output) + +
+ {/if} +
+
+ {#if last_updated_date} + Data last updated: {last_updated_date} + {/if} +
+
diff --git a/src/components/PageLink.svelte b/src/components/PageLink.svelte index 9205c2f..bccddf2 100644 --- a/src/components/PageLink.svelte +++ b/src/components/PageLink.svelte @@ -2,10 +2,11 @@ import { refresh_page } from '../lib/stores.js'; export let page; +export let extra_classes = ''; function handleClick() { refresh_page(page); } - + diff --git a/src/components/ReverseBar.svelte b/src/components/ReverseBar.svelte deleted file mode 100644 index 62227c8..0000000 --- a/src/components/ReverseBar.svelte +++ /dev/null @@ -1,108 +0,0 @@ - - -
- -
- - - - gotoCoordinates(lon, lat)} - class="btn btn-outline-secondary btn-sm" - title="switch lat and lon"><> - - - - - -
- -
-
- - diff --git a/src/components/ReverseLink.svelte b/src/components/ReverseLink.svelte index f6657de..2fd2c4c 100644 --- a/src/components/ReverseLink.svelte +++ b/src/components/ReverseLink.svelte @@ -4,6 +4,7 @@ import { refresh_page } from '../lib/stores.js'; export let lat; export let lon; export let zoom = null; +export let extra_classes = ''; let params = new URLSearchParams(); let href = 'reverse.html'; @@ -29,4 +30,4 @@ $: { } - refresh_page('reverse', params)} href={href}> + refresh_page('reverse', params)} href={href} class={extra_classes}> diff --git a/src/components/SearchBar.svelte b/src/components/SearchBar.svelte deleted file mode 100644 index d0890a9..0000000 --- a/src/components/SearchBar.svelte +++ /dev/null @@ -1,243 +0,0 @@ - - -
- -
-
- - - -
- - - - - - - - -
-
-
-
- - - - - - - - -
- - - - - - - - -
-
-
- - -
-
-
- - - - - - -
-
- - - - -
-
- - - - -
-
-
-
-
- - diff --git a/src/components/SearchSection.svelte b/src/components/SearchSection.svelte new file mode 100644 index 0000000..9bc5090 --- /dev/null +++ b/src/components/SearchSection.svelte @@ -0,0 +1,225 @@ + + + + +
+
+ + + +
+ + + + + + + + +
+
+
+
+ + + + + + + + +
+ + + + + + + + +
+
+
+ + +
+
+
+ + + + + + +
+
+ + + + +
+
+ + + + +
+
+
+
+ + diff --git a/src/components/SearchSectionDetails.svelte b/src/components/SearchSectionDetails.svelte new file mode 100644 index 0000000..7429dbd --- /dev/null +++ b/src/components/SearchSectionDetails.svelte @@ -0,0 +1,96 @@ + + + + +
+
+
+ + + + +
+
+ +
+
+ + +
+
+ +
+
+ + + + +
+
+
+ + diff --git a/src/components/SearchSectionReverse.svelte b/src/components/SearchSectionReverse.svelte new file mode 100644 index 0000000..108e3b6 --- /dev/null +++ b/src/components/SearchSectionReverse.svelte @@ -0,0 +1,88 @@ + + + +
+ + + + gotoCoordinates(lon, lat)} + class="btn btn-outline-secondary btn-sm" + title="switch lat and lon"><> + + + + + +
+
+ + diff --git a/src/pages/DeletablePage.svelte b/src/pages/DeletablePage.svelte index 1d6b91e..6bc80ce 100644 --- a/src/pages/DeletablePage.svelte +++ b/src/pages/DeletablePage.svelte @@ -3,6 +3,7 @@ import { fetch_from_api, update_html_title } from '../lib/api_utils.js'; import { osmLink } from '../lib/helpers.js'; + import Header from '../components/Header.svelte'; import DetailsLink from '../components/DetailsLink.svelte'; let aPolygons = []; @@ -16,6 +17,7 @@ onMount(loaddata); +
diff --git a/src/pages/DetailsPage.svelte b/src/pages/DetailsPage.svelte index 585ce3b..d480050 100644 --- a/src/pages/DetailsPage.svelte +++ b/src/pages/DetailsPage.svelte @@ -6,8 +6,9 @@ osmLink, wikipediaLink, coverageType, isAdminBoundary, formatAddressRank, formatKeywordToken } from '../lib/helpers.js'; + import Header from '../components/Header.svelte'; import MapIcon from '../components/MapIcon.svelte'; - import DetailsIndex from '../components/DetailsIndex.svelte'; + import SearchSectionDetails from '../components/SearchSectionDetails.svelte'; import DetailsOneRow from '../components/DetailsOneRow.svelte'; import DetailsLink from '../components/DetailsLink.svelte'; import Map from '../components/Map.svelte'; @@ -16,9 +17,10 @@ let errorResponse; let base_url = window.location.search; let current_result; + let api_request_params; function loaddata(search_params) { - var api_request_params = { + api_request_params = { place_id: search_params.get('place_id'), osmtype: search_params.get('osmtype'), osmid: search_params.get('osmid'), @@ -63,6 +65,9 @@ } +
+ +
{#if errorResponse} {errorResponse.error.message} {/if} @@ -270,7 +275,7 @@
{:else if (window.location.search === '')} - + {:else} No such place found. {/if} diff --git a/src/pages/PolygonsPage.svelte b/src/pages/PolygonsPage.svelte index e61d89a..0dc8a20 100644 --- a/src/pages/PolygonsPage.svelte +++ b/src/pages/PolygonsPage.svelte @@ -3,6 +3,8 @@ import { fetch_from_api, update_html_title } from '../lib/api_utils.js'; import { formatOSMType, osmLink } from '../lib/helpers.js'; + import Header from '../components/Header.svelte'; + let aPolygons = []; function loaddata() { @@ -14,7 +16,7 @@ onMount(loaddata); - +
diff --git a/src/pages/ReversePage.svelte b/src/pages/ReversePage.svelte index a990646..bdc7811 100644 --- a/src/pages/ReversePage.svelte +++ b/src/pages/ReversePage.svelte @@ -3,7 +3,8 @@ import { get_config_value } from '../lib/config_reader.js'; import { fetch_from_api, update_html_title } from '../lib/api_utils.js'; - import ReverseBar from '../components/ReverseBar.svelte'; + import Header from '../components/Header.svelte'; + import SearchSectionReverse from '../components/SearchSectionReverse.svelte'; import ResultsList from '../components/ResultsList.svelte'; import Map from '../components/Map.svelte'; @@ -52,7 +53,9 @@ } - +
+ +