Actually show full parents when requested

This commit is contained in:
Simon Bruder 2024-07-16 19:07:01 +02:00
parent b55c8373d3
commit cfaaa01fbf
Signed by: simon
GPG key ID: 347FF8699CDA0776

View file

@ -229,7 +229,12 @@ pub fn parents_breadcrumb(
@if !full && parents.len() > LIMIT { @if !full && parents.len() > LIMIT {
li .breadcrumb-item { "" } li .breadcrumb-item { "" }
} }
@for parent in parents.iter().rev().take(LIMIT).rev() { @let parents: Box<dyn Iterator<Item = &Item>> = if full {
Box::new(parents.iter())
} else {
Box::new(parents.iter().rev().take(LIMIT).rev())
};
@for parent in parents {
li .breadcrumb-item { li .breadcrumb-item {
a href={ "/item/" (parent.id) } { (ItemName::new(parent, parents_item_classes.get(&parent.class).unwrap()) )} a href={ "/item/" (parent.id) } { (ItemName::new(parent, parents_item_classes.get(&parent.class).unwrap()) )}
} }