From 02c82d3e46d781853ee80c7d9c215d3d8a94b3a1 Mon Sep 17 00:00:00 2001
From: Christian Beutel <>
Date: Mon, 11 Mar 2024 00:08:02 +0100
Subject: [PATCH] adds new default state images
---
docker-compose.yml | 2 +-
search/bootstrap.py | 6 +--
web/src/hooks.server.ts | 2 +-
.../empty_states/empty_state_search.svelte | 2 +-
web/src/lib/components/nav_bar.svelte | 8 +--
.../lib/components/trail/trail_card.svelte | 6 ++-
.../lib/components/trail/trail_list.svelte | 2 +-
.../components/trail/trail_list_item.svelte | 16 +++---
web/src/lib/i18n/locales/de.json | 13 ++++-
web/src/lib/i18n/locales/en.json | 11 +++-
web/src/lib/models/trail.ts | 29 +++--------
web/src/lib/stores/trail_store.ts | 4 +-
web/src/lib/util/authorization_util.ts | 3 +-
web/src/routes/+layout.svelte | 2 +-
web/src/routes/+page.svelte | 49 +++++++++++++-----
web/src/routes/login/+page.svelte | 17 +++---
web/src/routes/map/+page.svelte | 38 ++++++++------
web/src/routes/map/+page.ts | 18 +++++++
web/src/routes/map/trail/[id]/+page.svelte | 6 ++-
web/src/routes/register/+page.svelte | 24 +++++----
web/src/routes/trail/edit/[id]/+page.svelte | 25 +++++++--
web/src/routes/trail/view/[id]/+page.svelte | 6 ++-
web/static/imgs/default_thumbnail.webp | Bin 0 -> 157152 bytes
web/static/imgs/empty_state.png | Bin 0 -> 52217 bytes
web/static/imgs/empty_state.webp | Bin 291168 -> 0 bytes
25 files changed, 191 insertions(+), 98 deletions(-)
create mode 100644 web/static/imgs/default_thumbnail.webp
create mode 100644 web/static/imgs/empty_state.png
delete mode 100644 web/static/imgs/empty_state.webp
diff --git a/docker-compose.yml b/docker-compose.yml
index 68a0602e..38df48cf 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -46,7 +46,7 @@ services:
build: ./web
environment:
<<: *cenv
- MEILI_API_TOKEN:
+ MEILI_API_TOKEN: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcGlLZXlVaWQiOiIwZDA0YTAzYy1iNzBjLTQzZTctOGUzMC00NjNiODFhM2UwY2YiLCJzZWFyY2hSdWxlcyI6eyJ0cmFpbHMiOnsiZmlsdGVyIjoicHVibGljPXRydWUifSwiY2l0aWVzNTAwIjp7fX0sImV4cCI6bnVsbH0.XhHwyRqtKjij2-oPvcYAL3uIFmB4lxUBUgVzhQqL1To
ORIGIN: http://localhost:8080
PUBLIC_POCKETBASE_URL: http://db:8090
ports:
diff --git a/search/bootstrap.py b/search/bootstrap.py
index 3edc95b2..a90f7a55 100644
--- a/search/bootstrap.py
+++ b/search/bootstrap.py
@@ -43,8 +43,8 @@ def init_indices():
def generate_public_token():
- search_key = client.get_keys().results[0]
-
+ search_key = next(filter(lambda r: r.name == "Default Search API Key", client.get_keys().results))
+
search_rules = {
'trails': {
'filter': 'public=true'
@@ -60,6 +60,6 @@ init_indices()
print("Indices initialized!")
token = generate_public_token()
print("Generating public token...")
-print(f"PUBLIC_MEILISEARCH_API_TOKEN:{token}")
+print(f"MEILI_API_TOKEN: {token}")
print("Bootstrapping complete!")
diff --git a/web/src/hooks.server.ts b/web/src/hooks.server.ts
index bcc6303f..c3d5968d 100644
--- a/web/src/hooks.server.ts
+++ b/web/src/hooks.server.ts
@@ -12,7 +12,7 @@ export const handle: Handle = async ({ event, resolve }) => {
// validate the user existence and if the path is acceesible
if (!pb.authStore.model && isRouteProtected(url.pathname)) {
- throw redirect(302, '/login');
+ throw redirect(302, '/login?r='+url.pathname);
} else if (pb.authStore.model && url.pathname === "/login") {
throw redirect(302, '/');
}
diff --git a/web/src/lib/components/empty_states/empty_state_search.svelte b/web/src/lib/components/empty_states/empty_state_search.svelte
index cc8bf4e1..161f8ccd 100644
--- a/web/src/lib/components/empty_states/empty_state_search.svelte
+++ b/web/src/lib/components/empty_states/empty_state_search.svelte
@@ -7,7 +7,7 @@
diff --git a/web/src/lib/components/nav_bar.svelte b/web/src/lib/components/nav_bar.svelte
index 7130ae16..a5c0df6b 100644
--- a/web/src/lib/components/nav_bar.svelte
+++ b/web/src/lib/components/nav_bar.svelte
@@ -78,7 +78,7 @@
function handleDropdownClick(item: { text: string; value: any }) {
if (item.value == "logout") {
logout();
- goto("/");
+ window.location.href = "/";
} else if (item.value == "profile") {
goto("/profile");
}
@@ -117,7 +117,7 @@