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

Cookie banner feedback #1397

Merged
merged 5 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions di_website/templates/includes/scaffold/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<h4 class="footer__title" style="padding-top: 2em;">Cookie preferences</h4>
<ul class="footer__list">
<li>
<a id="change_cookie_preferences"></a>
<a
href="#"
class="button"
Expand Down
33 changes: 7 additions & 26 deletions di_website/templates/tags/cookie_notice.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{% load wagtailcore_tags string_utils %}

{% csrf_token %}
{% if request.get_full_path|remove_url_parameters != notice.set_cookie_page.url %}
<div class="notice__wrapper notice__wrapper--notice display-none" data-notice id="cookie_notice">
<div class="row">
<div class="notice__content">
Expand All @@ -18,32 +17,14 @@ <h2>{{ notice.heading }}</h2>
Accept necessary cookies
</button>
{% if notice.set_cookie_page %}
<a target="_blank" rel="noopener" href="{% pageurl notice.set_cookie_page %}" class="button button--reverse">
View cookies
</a>
{% if request.get_full_path|remove_url_parameters != notice.set_cookie_page.url %}
<a target="_blank" rel="noopener" href="{% pageurl notice.set_cookie_page %}" class="button button--reverse">
View cookies
</a>
{% endif %}
{% endif %}
<p>You can change your preferences at any time by visiting our Privacy and cookies policy.</p>
<p>You can change your preferences at any time by clicking the button at the bottom of this page.</p>
</div>
</div>
</div>
{% else %}
<script>document.cookie = 'cookie_notice=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;'</script>
<div class="notice__wrapper notice__wrapper--notice display-none" data-notice id="cookie_notice">
<div class="row">
<div class="notice__content">
{% if notice.heading %}
<h2>{{ notice.heading }}</h2>
{% endif %}
{% if notice.body %}
<p>{{ notice.body }}</p>
{% endif %}
<button data-notice-accept-all id="cookie_notice" class="button--radio {% if request.COOKIES.cookie_notice_choice == 'all' %}button--radioactive{% endif %}">
Accept all cookies
</button>
<button data-notice-accept-necessary id="cookie_notice" class="button--radio {% if request.COOKIES.cookie_notice_choice == 'necessary' %}button--radioactive{% endif %}">
Accept necessary cookies
</button>
</div>
</div>
</div>
{% endif %}

52 changes: 0 additions & 52 deletions patterns/assets/css/modules/_message.scss
Original file line number Diff line number Diff line change
@@ -1,25 +1,3 @@
// ------------------------------------------------------------
// notice
// ------------------------------------------------------------

// .body--message {
// // used to modify the body and absolutely positioned elements within
// // make the header relative
// .hero {
// @include respond-to-max($menu-respond) {
// margin-top: -13.5em;
// padding-top: 13.5em;
// &:before {
// height: 200%;
// top: -200%;
// }
// }
// @include respond-to($menu-respond) {
// margin-top: -15em;
// }
// }
// }

.notice__wrapper {
position: fixed;
bottom: 0;
Expand Down Expand Up @@ -55,36 +33,6 @@
button,a {
margin: 0.2em;
}
.button--radio {
display: flex;
align-items: center;
padding: 5px 10px;
background: none;
border: none;
cursor: pointer;
outline: none;
font-size: 16px;
color: #fff;
}
.button--radio::before {
content: '';
display: inline-block;
width: 16px;
height: 16px;
margin-right: 8px;
border: 2px solid #000;
border-radius: 50%;
background-color: #fff;
}
.button--radioactive::before {
background-color: #000;
background-clip: content-box;
border: 4px solid #fff;
}
.button--active {
color: $slate;
background-color: #fff;
}
strong, b {
@extend %font-heading;
}
Expand Down
Loading
Loading