|
|
|
@ -44,44 +44,44 @@ impl<'a> DustRenderer<'a> {
|
|
|
|
|
.insert(template.name.clone(), &template.template);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn new_breadcrumbs_section<'b, B>(
|
|
|
|
|
&self,
|
|
|
|
|
maybe_breadcrumbs: Option<&'a BreadcrumbTreeNode<B>>,
|
|
|
|
|
index_context: Option<&'b dyn IntoContextElement>,
|
|
|
|
|
injected_context: Option<&'b dyn IntoContextElement>,
|
|
|
|
|
explicit_context: &Option<Path<'b>>,
|
|
|
|
|
new_context_element: Option<&'b dyn ContextElement>,
|
|
|
|
|
) -> Option<&'a BreadcrumbTreeNode<B>>
|
|
|
|
|
where
|
|
|
|
|
B: IntoContextElement,
|
|
|
|
|
{
|
|
|
|
|
// If there is no new content, return the original breadcrumbs
|
|
|
|
|
match (
|
|
|
|
|
index_context,
|
|
|
|
|
injected_context,
|
|
|
|
|
explicit_context,
|
|
|
|
|
new_context_element,
|
|
|
|
|
) {
|
|
|
|
|
(None, None, None, None) => return maybe_breadcrumbs,
|
|
|
|
|
_ => (),
|
|
|
|
|
}
|
|
|
|
|
// fn new_breadcrumbs_section<'b, B>(
|
|
|
|
|
// &self,
|
|
|
|
|
// maybe_breadcrumbs: Option<&'a BreadcrumbTreeNode<B>>,
|
|
|
|
|
// index_context: Option<&'b dyn IntoContextElement>,
|
|
|
|
|
// injected_context: Option<&'b dyn IntoContextElement>,
|
|
|
|
|
// explicit_context: &Option<Path<'b>>,
|
|
|
|
|
// new_context_element: Option<&'b dyn ContextElement>,
|
|
|
|
|
// ) -> Option<&'a BreadcrumbTreeNode<B>>
|
|
|
|
|
// where
|
|
|
|
|
// B: IntoContextElement,
|
|
|
|
|
// {
|
|
|
|
|
// // If there is no new content, return the original breadcrumbs
|
|
|
|
|
// match (
|
|
|
|
|
// index_context,
|
|
|
|
|
// injected_context,
|
|
|
|
|
// explicit_context,
|
|
|
|
|
// new_context_element,
|
|
|
|
|
// ) {
|
|
|
|
|
// (None, None, None, None) => return maybe_breadcrumbs,
|
|
|
|
|
// _ => (),
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// If there is an explicit context, then drop all the current
|
|
|
|
|
// context
|
|
|
|
|
let mut new_stack = match explicit_context {
|
|
|
|
|
Some(_) => None,
|
|
|
|
|
None => maybe_breadcrumbs,
|
|
|
|
|
};
|
|
|
|
|
// // If there is an explicit context, then drop all the current
|
|
|
|
|
// // context
|
|
|
|
|
// let mut new_stack = match explicit_context {
|
|
|
|
|
// Some(_) => None,
|
|
|
|
|
// None => maybe_breadcrumbs,
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
|
|
// TODO: Explicit context
|
|
|
|
|
injected_context.map(|ctx| {
|
|
|
|
|
new_stack = Some(BreadcrumbTreeNode {
|
|
|
|
|
parent: new_stack.map(|b| b as _),
|
|
|
|
|
element: BreadcrumbTreeNodeElement::Borrowed(ctx),
|
|
|
|
|
});
|
|
|
|
|
// TODO
|
|
|
|
|
});
|
|
|
|
|
// // TODO: Explicit context
|
|
|
|
|
// // injected_context.map(|ctx| {
|
|
|
|
|
// // new_stack = Some(BreadcrumbTreeNode {
|
|
|
|
|
// // parent: new_stack.map(|b| b as _),
|
|
|
|
|
// // element: BreadcrumbTreeNodeElement::Borrowed(ctx),
|
|
|
|
|
// // });
|
|
|
|
|
// // // TODO
|
|
|
|
|
// // });
|
|
|
|
|
|
|
|
|
|
None
|
|
|
|
|
}
|
|
|
|
|
// None
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|