diff options
Diffstat (limited to 'ui/src/components/items.rs')
| -rw-r--r-- | ui/src/components/items.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ui/src/components/items.rs b/ui/src/components/items.rs new file mode 100644 index 0000000..c9e0d41 --- /dev/null +++ b/ui/src/components/items.rs @@ -0,0 +1,22 @@ +/* + This file is part of jellything (https://codeberg.org/metamuffin/jellything) + which is licensed under the GNU Affero General Public License (version 3); see /COPYING. + Copyright (C) 2026 metamuffin <metamuffin.org> +*/ + +use crate::{RenderInfo, components::node_card::NodeCard, page}; +use jellycommon::{Nku, routes::u_items_cont}; +use jellyui_locale::tr; + +page!(Items<'_>, |x| tr(x.ri.lang, "items")); + +markup::define! { + Items<'a>(ri: &'a RenderInfo<'a>, items: &'a [Nku<'a>], cont: Option<String>) { + ul.nl.grid { @for nku in *items { + li { @NodeCard { ri, nku } } + }} + @if let Some(cont) = cont { + a.next_page[href=u_items_cont(cont)] { button { "Show more" } } + } + } +} |