From 75781a4f98e786feb86a9c7bf9b0aa54cc2dde25 Mon Sep 17 00:00:00 2001 From: jen Date: Tue, 15 Aug 2023 17:08:44 +0100 Subject: [PATCH] mimic apply footer --- .../components/proxyMiddleware/index.ts | 5 ++- src/server/views/apply/apply-footer.njk | 34 +++++++++++++++++++ src/server/views/apply/question-page.njk | 6 ++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 src/server/views/apply/apply-footer.njk diff --git a/src/server/components/proxyMiddleware/index.ts b/src/server/components/proxyMiddleware/index.ts index 2ae3c8255..59afb52f4 100644 --- a/src/server/components/proxyMiddleware/index.ts +++ b/src/server/components/proxyMiddleware/index.ts @@ -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"); diff --git a/src/server/views/apply/apply-footer.njk b/src/server/views/apply/apply-footer.njk new file mode 100644 index 000000000..1ec6f1cee --- /dev/null +++ b/src/server/views/apply/apply-footer.njk @@ -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' + } + ] + } +}) }} diff --git a/src/server/views/apply/question-page.njk b/src/server/views/apply/question-page.njk index ed482fc03..0f434ca6b 100644 --- a/src/server/views/apply/question-page.njk +++ b/src/server/views/apply/question-page.njk @@ -1,4 +1,6 @@ {% extends "./../layout.njk" %} +{% from "button/macro.njk" import govukButton %} + {% block pageTitle %} {{ SERVICE_NAME }}{{ " - " + partialPageTitle if partialPageTitle }} @@ -30,3 +32,7 @@ {% endblock %} + +{% block footer %} + {% include "./apply-footer.njk" %} +{% endblock %}