From 8e77ad7204c92c348382466f9131afe547e1965c Mon Sep 17 00:00:00 2001
From: Simon Repp
Date: Sat, 20 Apr 2024 23:42:41 +0200
Subject: [PATCH] Render no breadcrumbs and highlight no site tree node on
auxiliary pages
---
src/editor/endpoints/collection.rs | 2 +-
src/editor/endpoints/index.rs | 26 ++++-----
src/editor/endpoints/playlist.rs | 2 +-
src/editor/endpoints/video.rs | 4 +-
src/editor/widgets.rs | 89 ++++++++++++++++++------------
5 files changed, 70 insertions(+), 53 deletions(-)
diff --git a/src/editor/endpoints/collection.rs b/src/editor/endpoints/collection.rs
index 1e77563..2d1291f 100644
--- a/src/editor/endpoints/collection.rs
+++ b/src/editor/endpoints/collection.rs
@@ -415,7 +415,7 @@ pub fn edit_page(
let site = context.get_site();
let head_title = collection.title.as_deref().unwrap_or_else(|| collection.slug());
- let html = layout(context, path, &site, &body, head_title);
+ let html = layout(context, Some(path), &site, &body, head_title);
HttpResponse::Ok()
.content_type(ContentType::html())
diff --git a/src/editor/endpoints/index.rs b/src/editor/endpoints/index.rs
index 699812a..6803927 100644
--- a/src/editor/endpoints/index.rs
+++ b/src/editor/endpoints/index.rs
@@ -124,7 +124,7 @@ pub async fn index(context: Data>) -> HttpResponse {
}
}
- let html = layout(&context, "", &site, &body, site.title());
+ let html = layout(&context, None, &site, &body, site.title());
HttpResponse::Ok()
.content_type(ContentType::html())
@@ -237,19 +237,17 @@ fn storage_stats_html(context: &Context, videos: &Vec>) -> String {
let total_size_human = human_size(total_size);
formatdoc!(r#"
-
+
"#)
}
\ No newline at end of file
diff --git a/src/editor/endpoints/playlist.rs b/src/editor/endpoints/playlist.rs
index 5a91068..7b06fe5 100644
--- a/src/editor/endpoints/playlist.rs
+++ b/src/editor/endpoints/playlist.rs
@@ -340,7 +340,7 @@ pub fn edit_page(
let site = context.get_site();
let head_title = playlist.title.as_deref().unwrap_or_else(|| playlist.slug());
- let html = layout(context, path, &site, &body, head_title);
+ let html = layout(context, Some(path), &site, &body, head_title);
HttpResponse::Ok()
.content_type(ContentType::html())
diff --git a/src/editor/endpoints/video.rs b/src/editor/endpoints/video.rs
index 5490d34..77d05c1 100644
--- a/src/editor/endpoints/video.rs
+++ b/src/editor/endpoints/video.rs
@@ -549,7 +549,7 @@ pub fn edit_page(
and all versions of the video. If the video lies at the
site root it does not remove the site manifest and the site itself,
so the site can afterwards be reinitialized again as a collection,
- video or video.
+ playlist or video.