Skip to content

Commit

Permalink
mimic apply footer
Browse files Browse the repository at this point in the history
  • Loading branch information
jenbutongit committed Aug 15, 2023
1 parent 6b5f40e commit 75781a4
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/server/components/proxyMiddleware/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ export function configureFormRunnerProxyMiddleware(server: Express): void {
if (userReq.baseUrl.includes("assets/")) {
return proxyResData;
}
return proxyResData.toString("utf8").replace(/(href|src|value)=('|")\/([^'"]+)/g, `$1=$2/application/$3`);
return proxyResData
.toString("utf8")
.replace(/(href|src|value)=('|")\/([^'"]+)/g, `$1=$2/application/$3`)
.replace(/(href|src|value)=('|")([^'"])(.*sitemap)[^'"]/g, `$1=/sitemap`);
},
userResHeaderDecorator(headers, userReq, userRes) {
const isApplicationRequest = userReq.originalUrl.startsWith("/application");
Expand Down
34 changes: 34 additions & 0 deletions src/server/views/apply/apply-footer.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{% from "footer/macro.njk" import govukFooter %}

{# mimics footer found on form runner footer #}

{{ govukFooter({
meta: {
items: [
{
href: '/application/help/privacy',
text: 'Privacy'
},
{
href: '/application/help/cookies',
text: 'Cookies'
},
{
href: '/application/help/accessibility-statement',
text: 'Accessibility Statement'
},
{
href: '/application/help/terms-and-conditions',
text: 'Terms and Conditions'
},
{
href: '/sitemap',
text: 'Sitemap'
},
{
href: '/application/provider-contact/contact-us',
text: 'Contact Us'
}
]
}
}) }}
6 changes: 6 additions & 0 deletions src/server/views/apply/question-page.njk
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{% extends "./../layout.njk" %}
{% from "button/macro.njk" import govukButton %}


{% block pageTitle %}
{{ SERVICE_NAME }}{{ " - " + partialPageTitle if partialPageTitle }}
Expand Down Expand Up @@ -30,3 +32,7 @@

</div>
{% endblock %}

{% block footer %}
{% include "./apply-footer.njk" %}
{% endblock %}

0 comments on commit 75781a4

Please sign in to comment.