implement back/next pagination buttons

This commit is contained in:
yggverse 2025-09-08 14:35:51 +03:00
parent 1f2eb60318
commit 2ece29b414

View file

@ -256,22 +256,8 @@ fn index(public: &Public, page: Option<usize>) -> Result<String> {
))
}
/*if page.unwrap_or(1) * public.default_limit < total {
None
} else {
Some(uri!(index(search, Some(page.map_or(2, |p| p + 1)))))
}*/
if let Some(p) = page {
b.push(format!(
"=> /{} Next",
if p > 2 {
Some(format!("?page={}", p + 1))
} else {
None
}
.unwrap_or_default()
))
if page.unwrap_or(1) * public.default_limit < total {
b.push(format!("=> /?page={} Next", page.map_or(2, |p| p + 1)))
}
Ok(b.join("\n"))