aboutsummaryrefslogtreecommitdiff
path: root/server/src/routes/ui/node.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-10-24 07:40:51 +0200
committermetamuffin <metamuffin@disroot.org>2023-10-24 07:40:51 +0200
commitb462195f2dcfe457eae7791c14e4b834b2d5ab29 (patch)
tree492ba43952fa6798320f2b2bb4d4bd5484e2e4f2 /server/src/routes/ui/node.rs
parent6e9ccad881a7f887599bc8f3f6b9ca2424a2cc5e (diff)
parent55f7f06cecd5b6f5661f6f22e8bb3e0448b9713a (diff)
downloadjellything-b462195f2dcfe457eae7791c14e4b834b2d5ab29.tar
jellything-b462195f2dcfe457eae7791c14e4b834b2d5ab29.tar.bz2
jellything-b462195f2dcfe457eae7791c14e4b834b2d5ab29.tar.zst
Merge branch 'master' of codeberg.org:metamuffin/jellything
Diffstat (limited to 'server/src/routes/ui/node.rs')
-rw-r--r--server/src/routes/ui/node.rs41
1 files changed, 28 insertions, 13 deletions
diff --git a/server/src/routes/ui/node.rs b/server/src/routes/ui/node.rs
index e4d53e6..bb97146 100644
--- a/server/src/routes/ui/node.rs
+++ b/server/src/routes/ui/node.rs
@@ -72,7 +72,6 @@ pub async fn r_library_node_filter<'a>(
Ok(Either::Left(LayoutPage {
title: node.title.to_string(),
- show_back: true, //- !matches!(node.kind, NodeKind::Collection),
content: markup::new! {
@NodePage { node: &node, id: &id, children: &children, filter: &filter }
},
@@ -82,24 +81,37 @@ pub async fn r_library_node_filter<'a>(
markup::define! {
NodeCard<'a>(id: &'a str, node: &'a NodePublic) {
- @let cls = format!("node card {}", match node.kind {NodeKind::Channel => "aspect-square", NodeKind::Video => "aspect-thumb", NodeKind::Collection => "aspect-land", _ => "aspect-port"});
+ @let cls = format!("node card poster {}", match node.kind {NodeKind::Channel => "aspect-square", NodeKind::Video => "aspect-thumb", NodeKind::Collection => "aspect-land", _ => "aspect-port"});
div[class=cls] {
.poster {
- .inner {
- a[href=uri!(r_library_node(id))] {
- img[src=uri!(r_item_assets(id, AssetRole::Poster, Some(1024)))];
+ a[href=uri!(r_library_node(id))] {
+ img[src=uri!(r_item_assets(id, AssetRole::Poster, Some(1024)))];
+ }
+ @if matches!(node.kind, NodeKind::Collection | NodeKind::Channel) {
+ .cardhover.open {
+ a[href=&uri!(r_library_node(id))] { "Open" }
+ @Props { node }
}
- div.details {
- h3 { @node.title }
+ } else {
+ .cardhover.item {
+ a.play[href=&uri!(r_player(id, PlayerConfig::default()))] { "▶" }
@Props { node }
- p.description { @node.description }
- @if matches!(node.kind, NodeKind::Collection | NodeKind::Channel) {
- a[href=&uri!(r_library_node(id))] { "Open" }
- } else {
- a.play[href=&uri!(r_player(id, PlayerConfig::default()))] { "Watch now" }
- }
}
}
+ // .inner {
+ // a[href=uri!(r_library_node(id))] {
+ // img[src=uri!(r_item_assets(id, AssetRole::Poster, Some(1024)))];
+ // }
+ // div.details {
+ // h3 { @node.title }
+ // p.descriptioüwn { @node.description }
+ // @if matches!(node.kind, NodeKind::Collection | NodeKind::Channel) {
+ // a[href=&uri!(r_library_node(id))] { "Open" }
+ // } else {
+ // a.play[href=&uri!(r_player(id, PlayerConfig::default()))] { "Watch now" }
+ // }
+ // }
+ // }
}
div.title {
a[href=uri!(r_library_node(id))] {
@@ -167,6 +179,9 @@ markup::define! {
Rating::Imdb => { "IMDb Rating: " @value }
} }
}
+ @if let Some(d) = &node.release_date {
+ p { "Released " @d.to_rfc2822() }
+ }
}
}
}