Header-Footer template render updates.

This commit is contained in:
Patrick Fic
2022-04-22 15:12:20 -07:00
parent 478e03cbe7
commit f72169d98f

View File

@@ -163,19 +163,44 @@ export async function RenderTemplates(
: "50px",
},
}),
pdfOperations: templateAndData.map((template) => {
return {
pdfOperations: [
{
template: {
name: template.useShopSpecificTemplate
? `/${bodyshop.imexshopid}/${template.templateObject.name}`
: `/${template.templateObject.name}`,
...(renderAsHtml ? {} : { recipe: "chrome-pdf" }),
name: "/components/Header-Footer",
recipe: "chrome-pdf",
engine: "handlebars",
},
type: "append",
mergeWholeDocument: true,
renderForEveryPage: true,
};
}),
type: "merge",
},
...templateAndData.map((template) => {
return {
template: {
chrome: {
marginTop:
bodyshop.logo_img_path &&
bodyshop.logo_img_path.headerMargin &&
bodyshop.logo_img_path.headerMargin > 36
? bodyshop.logo_img_path.headerMargin
: "36px",
marginBottom:
bodyshop.logo_img_path &&
bodyshop.logo_img_path.footerMargin &&
bodyshop.logo_img_path.footerMargin > 50
? bodyshop.logo_img_path.footerMargin
: "50px",
},
name: template.useShopSpecificTemplate
? `/${bodyshop.imexshopid}/${template.templateObject.name}`
: `/${template.templateObject.name}`,
...(renderAsHtml ? {} : { recipe: "chrome-pdf" }),
},
type: "append",
// mergeWholeDocument: true,
// renderForEveryPage: true,
};
}),
],
},
data: {
...extend(