Skip to content

Commit

Permalink
Rename cookie banner to consent banner (#374)
Browse files Browse the repository at this point in the history
* Cookie banner renamed to consent banner

* Update video component

* Update styling and strings

* Update dependency

* Recompile assets

* Update Dutch translations
  • Loading branch information
robdekort authored Jan 5, 2024
1 parent e669f62 commit f0dfd9f
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 44 deletions.
2 changes: 1 addition & 1 deletion content/globals/seo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ data:
use_plausible: false
use_cloudflare_web_analytics: false
tracker_type: none
use_cookie_banner: false
use_consent_banner: false
36 changes: 20 additions & 16 deletions lang/en/strings.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,26 @@
'form_subject_sent' => 'Contact form sent',
'form_success' => 'Thank you, we received your message and will contact you as soon as possible.',

// Cookie banner
'cookie_accept_all' => 'Accept all',
'cookie_accept_selected' => 'Accept selected',
'cookie_ads' => 'Ads & tracking',
'cookie_ads_explanation' => 'Third party cookies used for advertisement.',
'cookie_analytics' => 'Analytics',
'cookie_analytics_explanation' => 'Third party cookies used for analytics.',
'cookie_explanation' => 'This site uses cookies that need consent.',
'cookie_embeds' => 'Video embeds',
'cookie_embeds_explanation' => 'Third party cookies used for embedded video\'s that can possibly track you.',
'cookie_embeds_disabled' => 'Accept video embed cookies to view this video.',
'cookie_functional' => 'Functional',
'cookie_functional_explanation' => 'First party cookies needed for the website to function. These can\'t be turned off.',
'cookie_title' => 'Cookies 🍪',
'cookie_learn_more' => 'Learn more',
'cookie_change_preferences' => 'Change cookie preferences',
// Consent banner
'consent_accept_all' => 'Accept all',
'consent_accept_selected' => 'Accept selected',
'consent_ads' => 'Ads & tracking',
'consent_ads_explanation' => 'Storage (like third party cookies) used for advertisement.',
'consent_ad_user_data' => 'User data',
'consent_ad_user_data_explanation' => 'Send user data related to advertising to Google.',
'consent_ad_personalization' => 'Ad personalization',
'consent_ad_personalization_explanation' => 'Get personalized advertising.',
'consent_analytics' => 'Analytics',
'consent_analytics_explanation' => 'Storage (like third party cookies) used for analytics.',
'consent_explanation' => 'This site uses third party services that need your consent.',
'consent_embeds' => 'Video embeds',
'consent_embeds_explanation' => 'Third party cookies used for embedded video\'s that can possibly track you.',
'consent_embeds_disabled' => 'Give consent to third party video embeds to view this video.',
'consent_functional' => 'Functional',
'consent_functional_explanation' => 'First party cookies needed for the website to function. These can\'t be turned off.',
'consent_title' => 'Consent',
'consent_learn_more' => 'Learn more',
'consent_change_preferences' => 'Change consent preferences',

// Footer
'on' => 'on',
Expand Down
19 changes: 9 additions & 10 deletions lang/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"Collection Taxonomies": "Collectie taxonomie\u00ebn",
"Collection defaults": "Standaardinstellingen voor collecties",
"Collections with Social Images": "Collecties met social images",
"Configure Google trackers and scripts and optionally inject them after cookie consent.": "Configureer Google trackers en scripts en injecteer ze desgewenst nadat toestemming is verkregen.",
"Configure Google trackers and scripts and optionally inject them after consent.": "Configureer Google trackers en scripts en injecteer ze desgewenst nadat toestemming is verkregen.",
"Configure an optional privacy statement.": "Configureer een optioneel privacy statement.",
"Configure favicons so they can be automatically generated.": "Configureer favicons, zodat deze automatisch gegenereerd kunnen worden.",
"Configure site verifications.": "Configureer site-verificaties.",
Expand All @@ -69,8 +69,7 @@
"Configure universal theme meta tags.": "Configureer universele thema-meta-tags.",
"Configure various Analytics Services.": "Configureer verschillende analyticsdiensten.",
"Consent": "Toestemming",
"Consent and Cookie Banner": "Toestemming en cookie-banner",
"Cookie banner": "Cookie banner",
"Consent banner": "Consentbanner",
"Copyright": "Copyright",
"Copyright configuration options.": "Copyright-configuratie-opties.",
"Copyright name": "Copyrightnaam",
Expand Down Expand Up @@ -105,12 +104,12 @@
"Enable if you want Peak to generate favicons. **Important**: you need to have the PHP Imagick module installed.": "Schakel het genereren van favicons in. **Belangirjk**: je moet de PHP Imagick-module hebben ge\u00efnstalleerd.",
"Enable if you want to specify a specific theme color for dark mode.": "Schakel in als je een specifieke themakleur voor donkere modus wilt configureren.",
"Enable if you want to specify theme colors for various browsers.": "Schakel in als je specifieke themakleuren voor verschillende browsers wilt configureren.",
"Enable the cookie banner. When you use `Google Analytics` or `Google Tag Manager`, make sure you load all tracking scripts via their service as in this case the banner uses the Google Consent API: https:\/\/developers.google.com\/tag-manager\/consent. When you use `Custom scripts`, all your scripts will be injected after consent.": "Schakel de cookiebanner in. Als je `Google Analytics` of `Google Tag Manager` gebruikt, zorg en dan voor dat je alle derde tracking-scripts via Google inlaadt. Deze methode maakt namelijk gebruikt van de Consent API: https:\/\/developers.google.com\/tag-manager\/consent. Als je `Aangepaste scripts` gebruikt worden alle derde scripts pas ge\u00efnjecteerd na toestemming van de bezoeker.",
"Enable the consent banner. When you use `Google Analytics` or `Google Tag Manager`, make sure you load all tracking scripts via their service as in this case the banner uses the Google Consent API: https:\/\/developers.google.com\/tag-manager\/consent. When you use `Custom scripts`, all your scripts will be injected after consent.": "Schakel de consentbanner in. Als je `Google Analytics` of `Google Tag Manager` gebruikt, zorg en dan voor dat je alle derde tracking-scripts via Google inlaadt. Deze methode maakt namelijk gebruikt van de Consent API: https:\/\/developers.google.com\/tag-manager\/consent. Als je `Aangepaste scripts` gebruikt worden alle derde scripts pas ge\u00efnjecteerd na toestemming van de bezoeker.",
"Entry": "Entry",
"Environments": "Omgevingen",
"Even if you anonymize IP's you need consent according to the GDPR.": "Zelfs als je IP's anonimiseerd, heb je volgens de GDPR nog steeds toestemming nodig.",
"Explainer": "Uitleg",
"Explainer for the current category when you use the cookie banner.": "Uitleg van de huidige categorie wanneer je de cookiebanner gebruikt.",
"Explainer for the current category when you use the consent banner.": "Uitleg van de huidige categorie wanneer je de consentbanner gebruikt.",
"External URL": "Externe URL",
"External domain": "Extern domein",
"Facebook": "Facebook",
Expand All @@ -135,7 +134,7 @@
"Google site verification": "Google site verification",
"HTML that should be rendered after opening `<body>`.": "De HTML die na het openen van de `<body>` geladen moet worden.",
"Hide by default": "Standaard verbergen",
"Hide the cookie banner by default. You can use this when you're only using it for video embeds.": "Verberg standaard de cookiebanner. Je kunt deze optie gebruiken als je de cookiebanner alleen voor (video)embeds gebruikt.",
"Hide the consent banner by default. You can use this when you're only using it for video embeds.": "Verberg standaard de consentbanner. Je kunt deze optie gebruiken als je de consentbanner alleen voor (video)embeds gebruikt.",
"Hourly": "Per uur",
"How often to instruct search engines to crawl.": "Hoe vaak je zoekmachines wenst te laten crawlen.",
"How to manipulate the title.": "Hoe de titel te manipuleren.",
Expand Down Expand Up @@ -209,7 +208,7 @@
"Redirects": "Redirects",
"Replace title": "Vervang titel",
"Response": "Antwoordcode",
"Revoke all users consent before this date. Use this when you added new trackers to GTM and your privacy policy changed. The cookie bar will reappear.": "Trek toestemming in van alle gebruikers die voor deze datum toestemming hebben verleend. Gebruik dit als er wijzigingen hebben plaatsgevonden. De cookiebanner zal voor iedereen weer verschijnen.",
"Revoke all users consent before this date and time. Use this when you changed consent settings, added scripts or changed trackers, or when your privacy policy has changed. The consent banner will reappear. Expects a time in the timezone configured for your application.": "Trek toestemming in van alle gebruikers die voor deze datum toestemming hebben verleend. Gebruik dit als je wijzigingen hebt doorgevoerd m.b.t. de consent banner, scripts, trackers of je privacy policy. De consentbanner zal voor iedereen weer verschijnen. Dit veld verwacht een tijd in de tijdzone waarin je applicatie is ingesteld.",
"Revoke consent before": "Trek toestemming in voor",
"Right": "Rechts",
"Run PWA's in a standalone browser mode.": "Draai PWA's in een zelfstandige browsermodus.",
Expand Down Expand Up @@ -290,7 +289,7 @@
"This entry's OG title, defaults to custom SEO title and title.": "De OG-titel van deze entry. Valt terug op de aangepaste SEO-titel en de gewone titel.",
"This entry's meta description. Max 160 characters.": "De meta-omschrijving van deze entry. Maximaal 160 characters.",
"This entry's title, defaults to title and site name.": "De titel van deze entry. Valt terug op de titel en de site-naam",
"This will be used in form consent and in the optional cookie banner.": "Dit wordt gebruikt in de toestemming die verleend moet worden bij een formulier en in de optionele cookiebanner.",
"This will be used in form consent and in the optional consent banner.": "Dit wordt gebruikt in de toestemming die verleend moet worden bij een formulier en in de optionele consentbanner.",
"Titel": "Titel",
"Tracker type": "Trackertype",
"Trackers": "Trackers",
Expand All @@ -308,8 +307,8 @@
"Website title": "Websitetitel",
"Weekly": "Wekelijks",
"When to noindex and nofollow by default.": "Wanneer noindex en nofollow standaard aan moeten staan.",
"When to render tracker tags and the cookie banner.": "Wanneer bepaalde tracker tags en de cookiebanner gerendered moeten worden.",
"When you use the cookie banner, scripts will be grouped under this category.": "Wanneer je de cookiebanner gebruikten, worden scripts onder deze categorie gegroepeerd.",
"When to render tracker tags and the consent banner.": "Wanneer bepaalde tracker tags en de consentbanner gerendered moeten worden.",
"When you use the consent banner, scripts will be grouped under this category.": "Wanneer je de consentbanner gebruikt, worden scripts onder deze categorie gegroepeerd.",
"Where should the canonical URL for this entry point to.": "Waar de canonical-url voor deze entry naartoe moet wijzen.",
"Wijs rollen toe om gebruikers in deze groep alle bijbehorende bevoegdheden te geven.": "Wijs rollen toe om gebruikers in deze groep alle bijbehorende bevoegdheden te geven.",
"XL": "XL",
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/build/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resources/css/site.css": {
"file": "assets/site-vroK8dvp.css",
"file": "assets/site-FCmdVlLq.css",
"isEntry": true,
"src": "resources/css/site.css"
},
Expand Down
6 changes: 3 additions & 3 deletions resources/blueprints/globals/seo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ tabs:
sections:
-
display: Environments
instructions: 'When to render tracker tags and the cookie banner.'
instructions: 'When to render tracker tags and the consent banner.'
fields:
-
import: 'statamic-peak-seo::globals_seo_trackers_environments'
Expand All @@ -87,8 +87,8 @@ tabs:
-
import: 'statamic-peak-seo::globals_seo_trackers_analytics'
-
display: 'Consent and Cookie Banner'
instructions: 'Configure Google trackers and scripts and optionally inject them after cookie consent.'
display: 'Consent banner'
instructions: 'Configure Google trackers and scripts and optionally inject them after consent.'
fields:
-
import: 'statamic-peak-seo::globals_seo_trackers_consent'
14 changes: 7 additions & 7 deletions resources/views/components/_video.antlers.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
#}}

<!-- /components/_video.antlers.html -->
{{ cookie_embeds =
{{ consent_embeds =
(environment == 'local' && seo:trackers_local && seo:embeds) or
(environment == 'staging' && seo:trackers_staging && seo:embeds) or
(environment == 'production' && seo:trackers_production && seo:embeds)
}}
<div
{{ if cookie_embeds }}
{{ if consent_embeds }}
x-data
{{ /if }}
class="
Expand All @@ -25,16 +25,16 @@
"
>
<div class="relative aspect-video">
{{ if cookie_embeds }}
{{ if consent_embeds }}
<div
x-show="!$store.cookieBanner.consent || !$store.cookieBanner.embeds"
x-show="!$store.consentBanner.getConsent() || !$store.consentBanner.getConsentValue('embeds')"
class="absolute z-10 inset-0 p-6 flex justify-center items-center bg-neutral/10 text-neutral/80"
>
<a @click.prevent="$store.cookieBanner.setConsent(null)" href="#" class="p-1 -m-1 underline focus:outline-none focus-visible:ring-2 ring-primary">
{{ trans:strings.cookie_embeds_disabled }}
<a @click.prevent="$store.consentBanner.revokeConsent()" href="#" class="p-1 -m-1 underline focus:outline-none focus-visible:ring-2 ring-primary">
{{ trans:strings.consent_embeds_disabled }}
</a>
</div>
<template x-if="$store.cookieBanner.consent && $store.cookieBanner.embeds">
<template x-if="$store.consentBanner.getConsent() && $store.consentBanner.getConsentValue('embeds')">
<iframe class="absolute top-0 left-0 w-full h-full" width="100%" src="{{ video_url | embed_url }}" height="auto" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</template>
{{ else }}
Expand Down
4 changes: 2 additions & 2 deletions resources/views/layout/_footer.antlers.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
{{ configuration:copyright_name ?? config:app:name }}
</span>

{{# Let's users reset their cookie consent when you use the cookie banner. #}}
{{ yield:reset_cookie_consent }}
{{# Let's users reset consent when you use the consent banner. #}}
{{ yield:reset_consent }}
</div>
{{ if social_media:social_media }}
<div class="flex space-x-2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
{{ trans :key="inline_label" }}
{{ if handle === 'consent' }}
{{ if configuration:privacy_statement_type == 'entry' }}
<a class="px-1 -m-1 underline rounded hover:text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-primary" href="{{ configuration:privacy_statement_entry:url }}">{{ trans:strings.cookie_learn_more }}</a>
<a class="px-1 -m-1 underline rounded hover:text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-primary" href="{{ configuration:privacy_statement_entry:url }}">{{ trans:strings.consent_learn_more }}</a>
{{ elseif configuration:privacy_statement_type == 'pdf' }}
<a class="px-1 -m-1 underline rounded hover:text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-primary" href="{{ configuration:privacy_statement_asset }}" target="_blank">{{ trans:strings.cookie_learn_more }}</a>
<a class="px-1 -m-1 underline rounded hover:text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-primary" href="{{ configuration:privacy_statement_asset }}" target="_blank">{{ trans:strings.consent_learn_more }}</a>
{{ /if }}
{{ /if }}
</span>
Expand Down
2 changes: 1 addition & 1 deletion starter-kit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ dependencies:
laravel/framework: ^10.16
studio1902/statamic-peak-browser-appearance: ^3.0
studio1902/statamic-peak-commands: ^3.0
studio1902/statamic-peak-seo: ^7.0
studio1902/statamic-peak-seo: ^8.0
studio1902/statamic-peak-tools: ^4.0

0 comments on commit f0dfd9f

Please sign in to comment.