From 2ff2d07b5ed265d0f4ce095002484fe771e51dae Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 25 Dec 2023 21:06:47 +0100 Subject: watchlist and some small fixes --- server/src/routes/ui/home.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'server/src/routes/ui/home.rs') diff --git a/server/src/routes/ui/home.rs b/server/src/routes/ui/home.rs index ed9f7c1..6a3b9a4 100644 --- a/server/src/routes/ui/home.rs +++ b/server/src/routes/ui/home.rs @@ -73,6 +73,12 @@ pub fn r_home(sess: Session, db: &State) -> MyResult { .filter(|(_, _, u)| matches!(u.watched, WatchedState::Progress(_))) .map(|k| k.to_owned()) .collect::>(); + + let watchlist = items + .iter() + .filter(|(_, _, u)| matches!(u.watched, WatchedState::Pending)) + .map(|k| k.to_owned()) + .collect::>(); Ok(LayoutPage { title: "Home".to_string(), @@ -87,6 +93,12 @@ pub fn r_home(sess: Session, db: &State) -> MyResult { li { @NodeCard { id, node, udata } } }}} } + @if !watchlist.is_empty() { + h2 { "Watchlist" } + .homelist { ul {@for (id, node, udata) in &watchlist { + li { @NodeCard { id, node, udata } } + }}} + } h2 { "Latest Releases" } .homelist { ul {@for (id, node, udata) in &latest { li { @NodeCard { id, node, udata } } -- cgit v1.2.3-70-g09d2