diff --git a/fala/assets-src/sass/main.scss b/fala/assets-src/sass/main.scss index 7f8e57a5..0624e8fe 100644 --- a/fala/assets-src/sass/main.scss +++ b/fala/assets-src/sass/main.scss @@ -179,3 +179,7 @@ body.fala-dev { border-color: transparent; } } + +.hidden { + display: none; +} \ No newline at end of file diff --git a/fala/assets-src/scripts/cookies.js b/fala/assets-src/scripts/cookies.js index 8d3d1965..68ea5841 100644 --- a/fala/assets-src/scripts/cookies.js +++ b/fala/assets-src/scripts/cookies.js @@ -58,17 +58,26 @@ if (cookiePolicyForm) { cookiePolicyForm.addEventListener("submit", (e) => { e.preventDefault(); const selectedValue = document.querySelector("input[name='cookies']:checked").value; + const notificationBanner = document.getElementById('cookieChoiceNotificationBanner'); if (selectedValue === "Allowed") { setCookie("cookiePermission", "Allowed", 30); tagMan(); if (cookieBanner) { cookieBanner.hidden = true; } + if (notificationBanner) { + notificationBanner.classList.remove("hidden"); + notificationBanner.scrollIntoView() + } } else if (selectedValue === "Rejected") { setCookie("cookiePermission", "Rejected", 30); if (cookieBanner) { cookieBanner.hidden = true; } + if (notificationBanner) { + notificationBanner.classList.remove("hidden"); + notificationBanner.scrollIntoView() + } } }); }; \ No newline at end of file diff --git a/fala/templates/adviser/cookies.html b/fala/templates/adviser/cookies.html index 248ca264..6780b6bb 100644 --- a/fala/templates/adviser/cookies.html +++ b/fala/templates/adviser/cookies.html @@ -3,11 +3,30 @@ {% block pageTitle %}Cookies{% endblock %} {%- from 'govuk_frontend_jinja/components/radios/macro.html' import govukRadios -%} +{%- from 'govuk_frontend_jinja/components/notification-banner/macro.html' import govukNotificationBanner -%} {% block content %}
+
+
+ {{ govukNotificationBanner({ + 'type': 'success', + 'role': 'alert', + 'titleText': 'Success', + 'text': 'Your cookie settings were saved', + 'html': '

Your cookie settings were saved

+

Other government services may set additional cookies. These will have a separate cookie policy and banner.

+

Go back to the page you were looking at

', + 'classes': 'hidden', + 'attributes': { + 'id': 'cookieChoiceNotificationBanner' + } + }) }} +
+
+

Cookies