Updated Partial for the new architecture.
This commit is contained in:
parent
b396765488
commit
250d428464
@ -306,6 +306,38 @@ impl<'a> DustRenderer<'a> {
|
|||||||
),
|
),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
DustTag::DTPartial(partial) => {
|
||||||
|
let partial_name = self.render_partial_name(&partial.name, breadcrumbs)?;
|
||||||
|
if partial.params.is_empty() {
|
||||||
|
let new_breadcrumbs = self.new_breadcrumbs_partial(
|
||||||
|
breadcrumbs,
|
||||||
|
breadcrumbs,
|
||||||
|
None,
|
||||||
|
&partial.explicit_context,
|
||||||
|
);
|
||||||
|
let rendered_content = self.render_template(
|
||||||
|
&partial_name,
|
||||||
|
new_breadcrumbs.as_ref().unwrap_or(breadcrumbs),
|
||||||
|
Some(blocks.blocks),
|
||||||
|
)?;
|
||||||
|
return Ok(rendered_content);
|
||||||
|
} else {
|
||||||
|
let injected_context =
|
||||||
|
ParametersContext::new(self, breadcrumbs, &partial.params);
|
||||||
|
let new_breadcrumbs = self.new_breadcrumbs_partial(
|
||||||
|
breadcrumbs,
|
||||||
|
breadcrumbs,
|
||||||
|
Some(&injected_context),
|
||||||
|
&partial.explicit_context,
|
||||||
|
);
|
||||||
|
let rendered_content = self.render_template(
|
||||||
|
&partial_name,
|
||||||
|
new_breadcrumbs.as_ref().unwrap_or(breadcrumbs),
|
||||||
|
Some(blocks.blocks),
|
||||||
|
)?;
|
||||||
|
return Ok(rendered_content);
|
||||||
|
}
|
||||||
|
}
|
||||||
_ => panic!("Unsupported tag"),
|
_ => panic!("Unsupported tag"),
|
||||||
}
|
}
|
||||||
Ok("".to_owned())
|
Ok("".to_owned())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user