From a326d5f17d708ae1b0b0c27935a88a93b03e3ebe Mon Sep 17 00:00:00 2001 From: jmanczak Date: Thu, 9 Apr 2026 15:31:21 +0200 Subject: [PATCH 1/2] don't dead link --- src/web/pages/dashboard.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/web/pages/dashboard.rs b/src/web/pages/dashboard.rs index 29c803f..b1ada09 100644 --- a/src/web/pages/dashboard.rs +++ b/src/web/pages/dashboard.rs @@ -18,7 +18,7 @@ use crate::{ const LINKS: &[(&str, &str, &str)] = &[ ("Add Quote", "/quotes/add", icons::QUOTE), - ("Add Person", "/persons/add", icons::CONTACT), + ("Add Person", "/persons", icons::CONTACT), ]; pub async fn page(req: Request) -> Result { From 9fa19d6cafc04c9227eb75bc91dbe635761fb7aa Mon Sep 17 00:00:00 2001 From: jmanczak Date: Thu, 9 Apr 2026 16:00:52 +0200 Subject: [PATCH 2/2] primitive not found page (better than nothing) --- src/web/pages/mod.rs | 3 +++ src/web/pages/notfound.rs | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 src/web/pages/notfound.rs diff --git a/src/web/pages/mod.rs b/src/web/pages/mod.rs index 1586a27..8107f8a 100644 --- a/src/web/pages/mod.rs +++ b/src/web/pages/mod.rs @@ -8,6 +8,7 @@ pub mod dashboard; pub mod index; pub mod login; pub mod logs; +pub mod notfound; pub mod persons; pub mod quotes; pub mod tags; @@ -35,6 +36,8 @@ pub fn pages() -> Router { .route("/quotes", get(quotes::page)) .route("/quotes/add", get(quotes::add::page)) .route("/quotes/add-form", post(quotes::add::form)) + // + .fallback(notfound::page) } pub fn base(title: &str, inner: Markup) -> Markup { diff --git a/src/web/pages/notfound.rs b/src/web/pages/notfound.rs new file mode 100644 index 0000000..5c4e6ee --- /dev/null +++ b/src/web/pages/notfound.rs @@ -0,0 +1,26 @@ +use axum::extract::Request; +use maud::{Markup, html}; + +use crate::{ + error::CompositeError, + users::{User, auth::UserAuthenticate}, + web::{components::nav::nav, pages::base}, +}; + +pub async fn page(req: Request) -> Result { + let u = User::authenticate(req.headers()).ok().flatten(); + Ok(base( + "Not Found | Mnemosyne", + html!( + (nav(u.as_ref(), req.uri().path())) + + div class="mx-auto max-w-4xl px-2 mt-8 mb-2" { + h1 class="text-4xl font-lora font-semibold mb-1" { "Not Found" } + p class="text-neutral-400 font-light" { + "No page found under" + span class="font-mono mx-1 px-1 py-.5 border border-neutral-200/25 rounded bg-neutral-950/25" {(req.uri().path())} + } + } + ), + )) +}