Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EL-1863: Cookie page updated popup #375

Merged
merged 7 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions fala/assets-src/sass/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,7 @@ body.fala-dev {
border-color: transparent;
}
}

.hidden {
display: none;
}
9 changes: 9 additions & 0 deletions fala/assets-src/scripts/cookies.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
});
};
18 changes: 18 additions & 0 deletions fala/templates/adviser/cookies.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,29 @@
{% 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 %}
<div class="govuk-grid-column-full">
<div id="google_translate_element" class="govuk-!-margin-bottom-6"></div>

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
MazOneTwoOne marked this conversation as resolved.
Show resolved Hide resolved
{{ govukNotificationBanner({
'type': 'success',
'role': 'alert',
'titleText': 'Success',
'text': 'Your cookie settings were saved',
'html': '<p>Government services may set additional cookies and, if so, will have their own cookie policy and banner.</p>
<p class="govuk-body"><a class="govuk-notification-banner__link" href="/">Go back to the page you were looking at</a></p>',
'classes': 'hidden',
'attributes': {
'id': 'cookieChoiceNotificationBanner'
}
}) }}
</div>
</div>

<h1 class="govuk-heading-xl">Cookies</h1>

<p class="govuk-body">
Expand Down