diff options
| author | metamuffin <metamuffin@disroot.org> | 2026-02-22 03:22:39 +0100 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2026-02-22 03:22:39 +0100 |
| commit | aa13fade6fcabf9122babac7ac812a433a81b627 (patch) | |
| tree | f284f4d1502e3c75d37508ee0e8219add6c095a6 /ui/src/components/node_list.rs | |
| parent | eb46c37ebf2453f334bac086dbf9e91837dd082b (diff) | |
| download | jellything-aa13fade6fcabf9122babac7ac812a433a81b627.tar jellything-aa13fade6fcabf9122babac7ac812a433a81b627.tar.bz2 jellything-aa13fade6fcabf9122babac7ac812a433a81b627.tar.zst | |
node highlight card + css cleanup
Diffstat (limited to 'ui/src/components/node_list.rs')
| -rw-r--r-- | ui/src/components/node_list.rs | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/ui/src/components/node_list.rs b/ui/src/components/node_list.rs index d1d16fb..679a11d 100644 --- a/ui/src/components/node_list.rs +++ b/ui/src/components/node_list.rs @@ -6,7 +6,7 @@ use crate::{ RenderInfo, - components::node_card::{NodeCard, NodeCardWide}, + components::node_card::{NodeCard, NodeCardHightlight, NodeCardWide}, }; use jellycommon::{jellyobject::Object, *}; use jellyui_locale::tr; @@ -17,20 +17,28 @@ markup::define! { @if let Some(title) = nl.get(NODELIST_TITLE) { h2 { @tr(ri.lang, title) } } - @if ds == NLSTYLE_GRID { - ul.nl.grid { @for nku in nl.iter(NODELIST_ITEM) { - li { @NodeCard { ri, nku } } - }} - } - @if ds == NLSTYLE_INLINE { - ul.nl.inline { @for nku in nl.iter(NODELIST_ITEM) { - li { @NodeCard { ri, nku } } - }} - } - @if ds == NLSTYLE_LIST { - ol.nl.list { @for nku in nl.iter(NODELIST_ITEM) { - li { @NodeCardWide { ri, nku } } - }} + @match ds { + NLSTYLE_GRID => { + ul.nl.grid { @for nku in nl.iter(NODELIST_ITEM) { + li { @NodeCard { ri, nku } } + }} + } + NLSTYLE_INLINE => { + ul.nl.inline { @for nku in nl.iter(NODELIST_ITEM) { + li { @NodeCard { ri, nku } } + }} + } + NLSTYLE_LIST => { + ol.nl.list { @for nku in nl.iter(NODELIST_ITEM) { + li { @NodeCardWide { ri, nku } } + }} + } + NLSTYLE_HIGHLIGHT => { + @if let Some(nku) = nl.get(NODELIST_ITEM) { + @NodeCardHightlight { ri, nku } + } + } + _ => {} } } } |