diff options
Diffstat (limited to 'ui/src')
| -rw-r--r-- | ui/src/components/node_card.rs | 4 | ||||
| -rw-r--r-- | ui/src/components/node_list.rs | 18 | ||||
| -rw-r--r-- | ui/src/components/node_page.rs | 12 |
3 files changed, 24 insertions, 10 deletions
diff --git a/ui/src/components/node_card.rs b/ui/src/components/node_card.rs index 00382c8..fc5738a 100644 --- a/ui/src/components/node_card.rs +++ b/ui/src/components/node_card.rs @@ -25,9 +25,9 @@ markup::define! { img[src=u_image(node.get(NO_PICTURES).unwrap_or_default().get(PICT_COVER).unwrap_or_default(), 512), loading="lazy"]; } .cardhover.item { - // @if node.media.is_some() { + @if node.has(NO_TRACK.0) { a.play.icon[href=u_node_slug_player(&slug)] { "play_arrow" } - // } + } @Props { ri, nku: *nku, full: false } } } diff --git a/ui/src/components/node_list.rs b/ui/src/components/node_list.rs index cea6cb1..87ccb08 100644 --- a/ui/src/components/node_list.rs +++ b/ui/src/components/node_list.rs @@ -6,11 +6,23 @@ use crate::{RenderInfo, components::node_card::NodeCard}; use jellycommon::{jellyobject::Object, *}; +use jellyui_locale::tr; markup::define! { NodeList<'a>(ri: &'a RenderInfo<'a>, nl: Object<'a>) { - ul.nl.grid { @for nku in nl.iter(NODELIST_ITEM) { - li { @NodeCard { ri, nku } } - }} + @let ds = nl.get(NODELIST_DISPLAYSTYLE).unwrap_or(NLSTYLE_GRID); + @if ds == NLSTYLE_GRID { + ul.nl.grid { @for nku in nl.iter(NODELIST_ITEM) { + li { @NodeCard { ri, nku } } + }} + } + @if ds == NLSTYLE_INLINE { + @if let Some(title) = nl.get(NODELIST_TITLE) { + h2 { @tr(ri.lang, title) } + } + ul.nl.inline { @for nku in nl.iter(NODELIST_ITEM) { + li { @NodeCard { ri, nku } } + }} + } } } diff --git a/ui/src/components/node_page.rs b/ui/src/components/node_page.rs index c045dcc..921f65d 100644 --- a/ui/src/components/node_page.rs +++ b/ui/src/components/node_page.rs @@ -105,11 +105,13 @@ markup::define! { // } // } // } - details { - summary { @tr(ri.lang, "media.tracks") } - ol { @for track in node.iter(NO_TRACK) { - li { "track" @track.get(TR_NAME) } - }} + @if node.has(NO_TRACK.0) { + details { + summary { @tr(ri.lang, "media.tracks") } + ol { @for track in node.iter(NO_TRACK) { + li { "track" @track.get(TR_NAME) } + }} + } } @if let Some(idents) = node.get(NO_IDENTIFIERS) { details { |