-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add custom headers and footers to the generated document
Previously, a template’s custom header and footer were not part of the generated HTML preview at all. Now, the headers and footers are included in the SSR page when the `renderTemplateFootersAndHeaders` attribute is `true`. This will allow us to conditionally turn on the headers and footers when DAT renders the HTML preview but not when it’s generating the PDF. This adds a number of attributes to one of the existing templates because they are required for the template to successfully render; see this issue for more info: #55 Part of #53
- Loading branch information
1 parent
c23547b
commit fc4d9c4
Showing
9 changed files
with
183 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<!doctype html> | ||
<title>A2J-Template-SSR Tests</title> | ||
<div id="mocha"></div> | ||
<div id="test-area"></div> | ||
<script src="../../node_modules/steal/steal.js" mocha="bdd" main="~/elements/a2j-template-ssr/a2j-template-ssr-test"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
models/fixtures-author/templates/guide1261-template2115.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
export default { | ||
guideId: '1261', | ||
templateId: '2115', | ||
updatedAt: '2021-12-08T17:51:00.688Z', | ||
active: true, | ||
title: 'Test template', | ||
header: '<p>This is a custom header. The author might use this to include court information or a caption. </p>\n', | ||
footer: '<p>This is a custom footer. The author might include this to display the fact that this form was created with the assistance of a specific legal aid organization or a court division. They might include <em>itallics</em> or <strong>bold text</strong> to make it stand out. </p>\n', | ||
rootNode: { | ||
tag: 'a2j-template', | ||
state: {}, | ||
children: [ | ||
{ tag: 'a2j-rich-text', | ||
state: { | ||
notes: '', | ||
userContent: 'Hello, <a2j-variable name="Client first name TE"></a2j-variable>.' | ||
} | ||
}, | ||
{ tag: 'a2j-section-title', | ||
state: { | ||
title: 'This is a Section Title', | ||
titleTag: 'h2', | ||
underline: true | ||
} | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters