diff options
Diffstat (limited to 'ui/src/components/node_list.rs')
| -rw-r--r-- | ui/src/components/node_list.rs | 18 |
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 } } + }} + } } } |