aboutsummaryrefslogtreecommitdiff
path: root/ui/src/components/node_list.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2026-02-17 18:12:40 +0100
committermetamuffin <metamuffin@disroot.org>2026-02-17 18:12:40 +0100
commit95606a9deed45ae285c2d4dee01de9d21a43b044 (patch)
tree0651833f91859561b4e946dde31283d0cbc7cbb4 /ui/src/components/node_list.rs
parent0816c3d092f0da85bc7bfa928d44fc3d4f1fcb90 (diff)
downloadjellything-95606a9deed45ae285c2d4dee01de9d21a43b044.tar
jellything-95606a9deed45ae285c2d4dee01de9d21a43b044.tar.bz2
jellything-95606a9deed45ae285c2d4dee01de9d21a43b044.tar.zst
inline node lists and home page
Diffstat (limited to 'ui/src/components/node_list.rs')
-rw-r--r--ui/src/components/node_list.rs18
1 files changed, 15 insertions, 3 deletions
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 } }
+ }}
+ }
}
}