From 95606a9deed45ae285c2d4dee01de9d21a43b044 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Tue, 17 Feb 2026 18:12:40 +0100 Subject: inline node lists and home page --- ui/src/components/node_list.rs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'ui/src/components/node_list.rs') 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 } } + }} + } } } -- cgit v1.3