gdpr 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e415d6b6900821ce66cc9252776b119cbbd75e04dbd2d417bb9fe4a6776cee84
4
- data.tar.gz: 4b81c17651db669cefc67f46748d00fb7babe758ab04258bfc2851aae41884dd
3
+ metadata.gz: f9e7345d5949d460c048ab970c54451c489f51193903505ec1c1237c517f4264
4
+ data.tar.gz: 70fbebfaaee16e47ff0a4833b601300db6c51a87351a4b76cc64dfffc9a70b67
5
5
  SHA512:
6
- metadata.gz: 22bf1a09d57bc65dd1c784fc9e6a18569bf2938b733e38830a2925e1b47c3eb05c7934163c5cfe43386cb0ee77a4f8004114fc00f4277e1e6113f87d799f6152
7
- data.tar.gz: fc51d1f1c0f3ac34a8c702c35786fab44bbff8c81c52e95d5c925c8af7e5bfecd770350c054f4f82f3c7550b03f7a9461f9ed40e8011136068883c7d0a699bdc
6
+ metadata.gz: eda7174597f56515fa91f5c7a4d8bd33ecfaa0c164f09e12625b19f0d885c1c3ffaa699b6e200ec0c92673235abe6b54033ca48b3458da345ee89feee1c158c6
7
+ data.tar.gz: 0f5ffbd0f21ef8fe9d119bfcdf7e8982d5fb3fc9c99686f11050fc84fdabc757089825e12221335961ebe9b2996ccf2965d3e77c955a0a4bb1f5477052b64fbc
data/README.md CHANGED
@@ -35,6 +35,28 @@ Add this to stylesheets:
35
35
 
36
36
  Set the privacy policy url in the locales.
37
37
 
38
+ ## Usage
39
+ This will display a cookie banner with both Validate & Reject buttons.
40
+ You can force the re-display of the banner with a button/link including a ".js-gdpr__cookie_consent__display_again" class.
41
+
42
+
43
+ If you have a GTAG marker you should use it like this
44
+ ```
45
+ <script>
46
+ window.dataLayer = window.dataLayer || [];
47
+ function gtag(){dataLayer.push(arguments);}
48
+ if (Cookies.get('gdpr.cookie_consent.ok') !== 'true') {
49
+ // Default ad_storage to 'denied'.
50
+ gtag('consent', 'default', {
51
+ 'ad_storage': 'denied',
52
+ 'analytics_storage': 'denied'
53
+ });
54
+ }
55
+ gtag('js', new Date());
56
+ gtag('config', 'G-XXXXXXXX');
57
+ </script>
58
+ ```
59
+
38
60
  ## Checklist
39
61
 
40
62
  https://www.eugdpr.org/
@@ -45,7 +67,7 @@ https://www.eugdpr.org/
45
67
  - [ ] Optin must be unchecked by default
46
68
  - [ ] Account must be deletable
47
69
  - [ ] Users must have access to their data
48
- - [ ] Users must be able to modify their data
70
+ - [ ] Users must be able to modify their data
49
71
 
50
72
  ## Thanks
51
73
 
@@ -1,7 +1,80 @@
1
+ /* global Cookies, gtag */
1
2
  //= require js.cookie
2
- $(function(){
3
- $('.js-gdpr__cookie_consent__buttons__ok').click(function() {
4
- Cookies.set('gdpr.cookie_consent.ok', true, { path: '/', expires: 365 });
5
- $('.js-gdpr__cookie_consent').remove();
6
- });
3
+ window.cookieConsent = {
4
+
5
+ init: function () {
6
+ 'use strict';
7
+ this.cookieBanner = document.querySelector('.js-gdpr__cookie_consent');
8
+ this.cookieConsentOkButton = document.querySelector('.js-gdpr__cookie_consent__buttons__ok');
9
+ this.cookieConsentKoButton = document.querySelector('.js-gdpr__cookie_consent__buttons__ko');
10
+ this.displayAgain = document.querySelector('.js-gdpr__cookie_consent__display_again');
11
+ this.bindActions();
12
+ this.manageBannerDisplay();
13
+ },
14
+
15
+ bindActions: function () {
16
+ 'use strict';
17
+ var that = this;
18
+ if (this.cookieConsentOkButton) {
19
+ this.cookieConsentOkButton.addEventListener('click', function () {
20
+ that.setCookieAcceptance(true);
21
+ });
22
+ }
23
+ if (this.cookieConsentKoButton) {
24
+ this.cookieConsentKoButton.addEventListener('click', function () {
25
+ that.setCookieAcceptance(false);
26
+ });
27
+ }
28
+ if (this.displayAgain) {
29
+ this.displayAgain.addEventListener('click', function (e) {
30
+ e.preventDefault();
31
+ e.stopPropagation();
32
+ that.displayBanner(true);
33
+ });
34
+ }
35
+ },
36
+
37
+ manageBannerDisplay: function () {
38
+ 'use strict';
39
+ var value;
40
+ value = Cookies.get('gdpr.cookie_consent.ok');
41
+ if (value === undefined) {
42
+ this.displayBanner(true);
43
+ }
44
+ },
45
+
46
+ displayBanner: function (display) {
47
+ 'use strict';
48
+ if (display) {
49
+ this.cookieBanner.style.display = 'block';
50
+ } else {
51
+ this.cookieBanner.style.display = 'none';
52
+ }
53
+ },
54
+
55
+ setCookieAcceptance: function (value) {
56
+ 'use strict';
57
+ Cookies.set('gdpr.cookie_consent.ok', value, { path: '/', expires: 365 });
58
+ this.displayBanner(false);
59
+ if (value) {
60
+ if (window.gtag !== undefined) {
61
+ gtag('consent', 'update', {
62
+ 'ad_storage': 'granted',
63
+ 'analytics_storage': 'granted'
64
+ });
65
+ }
66
+ }
67
+ },
68
+
69
+ invoke: function () {
70
+ 'use strict';
71
+ return {
72
+ init: this.init.bind(this)
73
+ };
74
+ }
75
+ }.invoke();
76
+
77
+ document.addEventListener('DOMContentLoaded', function () {
78
+ 'use strict';
79
+ window.cookieConsent.init();
7
80
  });
@@ -1,14 +1,21 @@
1
1
  .gdpr__cookie_consent
2
- position: fixed
3
- z-index: 999
4
- max-width: 500px
5
- right: 15px
6
- bottom: 15px
7
- left: 15px
8
- padding: 15px
9
- border: 1px solid #eee
10
- background: #fff
11
- font-size: 14px
2
+ background: #FFFFFF
3
+ border: 1px solid #EEEEEE
4
+ bottom: 15px
5
+ display: none
6
+ font-size: 14px
7
+ left: 15px
8
+ max-width: 500px
9
+ padding: 15px
10
+ position: fixed
11
+ right: 15px
12
+ z-index: 9999
12
13
 
13
- &__text
14
- margin-bottom: 15px
14
+ a
15
+ text-decoration: underline !important
16
+
17
+ &__text
18
+ margin-bottom: 15px
19
+
20
+ &__buttons__ko
21
+ margin-left: 3px
@@ -1,11 +1,10 @@
1
- <% if cookies && cookies['gdpr.cookie_consent.ok'] != 'true' %>
2
- <div class="gdpr__cookie_consent js-gdpr__cookie_consent">
3
- <div class="gdpr__cookie_consent__text">
4
- <%= t('gdpr.cookie_consent.text') %>
5
- <%= t('gdpr.cookie_consent.learn_more_html', link: t('gdpr.privacy_policy')) %>
6
- </div>
7
- <div class="gdpr__cookie_consent__buttons">
8
- <button class="gdpr__cookie_consent__buttons__ok js-gdpr__cookie_consent__buttons__ok btn btn-primary btn-sm btn-xs"> <%= t('gdpr.cookie_consent.button') %></button>
9
- </div>
1
+ <div class="gdpr__cookie_consent js-gdpr__cookie_consent">
2
+ <div class="gdpr__cookie_consent__text">
3
+ <%= t('gdpr.cookie_consent.text') %>
4
+ <%= t('gdpr.cookie_consent.learn_more_html', link: t('gdpr.privacy_policy')) %>
10
5
  </div>
11
- <% end %>
6
+ <div class="gdpr__cookie_consent__buttons">
7
+ <button class="gdpr__cookie_consent__buttons__ok js-gdpr__cookie_consent__buttons__ok btn btn-primary btn-sm btn-xs"> <%= t('gdpr.cookie_consent.button_ok') %></button>
8
+ <button class="gdpr__cookie_consent__buttons__ko js-gdpr__cookie_consent__buttons__ko btn btn-danger btn-sm btn-xs"> <%= t('gdpr.cookie_consent.button_ko') %></button>
9
+ </div>
10
+ </div>
@@ -2,6 +2,7 @@ de:
2
2
  gdpr:
3
3
  privacy_policy: https://gdpr.eu/cookies/
4
4
  cookie_consent:
5
- text: "Indem Sie Ihre Navigation auf dieser Website fortsetzen, akzeptieren Sie die Verwendung von Cookies, die insbesondere dazu dienen, Ihnen personalisierte Funktionen anzubieten und Ihre Besuche auf der Website zu erfassen."
6
- button: "Ich habe verstanden"
5
+ button_ko: "Verweigern"
6
+ button_ok: "Bestätigen"
7
7
  learn_more_html: "Für weitere Informationen und Einstellen der Cookies : <a href=\"%{link}\" target=\"_blank\">bitte hier klicken</a>."
8
+ text: "Indem Sie Ihre Navigation auf dieser Website fortsetzen, akzeptieren Sie die Verwendung von Cookies, die insbesondere dazu dienen, Ihnen personalisierte Funktionen anzubieten und Ihre Besuche auf der Website zu erfassen."
@@ -2,6 +2,7 @@ en:
2
2
  gdpr:
3
3
  privacy_policy: https://gdpr.eu/cookies/
4
4
  cookie_consent:
5
- text: 'By navigating on this website, you agree to our use of cookies to personalize certain website features and to measure the audience and use of this website.'
6
- button: "I agree"
5
+ button_ko: "Refuse"
6
+ button_ok: "Validate"
7
7
  learn_more_html: "To learn more about cookies and how to customize your cookies options: <a href=\"%{link}\" target=\"_blank\">click here</a>."
8
+ text: 'By navigating on this website, you agree to our use of cookies to personalize certain website features and to measure the audience and use of this website.'
@@ -2,6 +2,7 @@ es:
2
2
  gdpr:
3
3
  privacy_policy: https://gdpr.eu/cookies/
4
4
  cookie_consent:
5
- text: "Al continuar su navegación por este sitio, acepta la utilización de cookies, que tienen por objeto proponerle funcionalidades personalizadas y realizar mediciones de audiencia."
6
- button: "Entendido"
5
+ button_ko: "Denegar"
6
+ button_ok: "Validar"
7
7
  learn_more_html: "Para saber más y definir la configuración de estas cookies: <a href=\"%{link}\" target=\"_blank\">hacer clic aquí</a>."
8
+ text: "Al continuar su navegación por este sitio, acepta la utilización de cookies, que tienen por objeto proponerle funcionalidades personalizadas y realizar mediciones de audiencia."
@@ -2,6 +2,7 @@ fr:
2
2
  gdpr:
3
3
  privacy_policy: https://gdpr.eu/cookies/
4
4
  cookie_consent:
5
- text: "En poursuivant votre navigation sur ce site, vous acceptez l’utilisation de Cookies pour vous proposer notamment des fonctionnalités personnalisées et pour réaliser des mesures d’audience."
6
- button: "J'ai compris"
5
+ button_ko: "Refuser"
6
+ button_ok: "Valider"
7
7
  learn_more_html: "Pour en savoir plus et paramétrer ces cookies : <a href=\"%{link}\" target=\"_blank\">cliquer ici</a>."
8
+ text: "En poursuivant votre navigation sur ce site, vous acceptez l’utilisation de Cookies pour vous proposer notamment des fonctionnalités personnalisées et pour réaliser des mesures d’audience."
@@ -2,6 +2,7 @@ it:
2
2
  gdpr:
3
3
  privacy_policy: https://gdpr.eu/cookies/
4
4
  cookie_consent:
5
- text: "Proseguendo nella navigazione del Sito, l'utente acconsente all'utilizzo dei cookie allo scopo di fornire funzioni personalizzate e di misurazione dell'audience."
6
- button: "Ho capito"
5
+ button_ko: "Rifiutare"
6
+ button_ok: "Convalidare"
7
7
  learn_more_html: "Per maggiori informazioni e per configurare i cookie: <a href=\"%{link}\" target=\"_blank\">cliccare qui</a>."
8
+ text: "Proseguendo nella navigazione del Sito, l'utente acconsente all'utilizzo dei cookie allo scopo di fornire funzioni personalizzate e di misurazione dell'audience."
@@ -2,6 +2,7 @@ zh:
2
2
  gdpr:
3
3
  privacy_policy: https://gdpr.eu/cookies/
4
4
  cookie_consent:
5
- text: '在瀏覽本網站之時,您同意本網站收集閣下Cookies(如有)及用於獲取配置數據以及分析上網認識的瀏覽習慣。Cookies可免除閣下每次瀏覽網站是重新登記的麻煩,並追蹤閣下喜歡的網頁主題選項,為閣下提供更個性化服務。阁下如不希望接受Cookies,可以修改有关互联网选项或阁下计算机系统的浏览选项,但阁下可能因此无法使用或启动本网站的若干功能。'
6
- button: "同意"
5
+ button_ko: "拒绝"
6
+ button_ok: "证实"
7
7
  learn_more_html: "<a href=\"%{link}\" target=\"_blank\">關於Cookies以及設置閣下計算機系統的瀏</a>."
8
+ text: '在瀏覽本網站之時,您同意本網站收集閣下Cookies(如有)及用於獲取配置數據以及分析上網認識的瀏覽習慣。Cookies可免除閣下每次瀏覽網站是重新登記的麻煩,並追蹤閣下喜歡的網頁主題選項,為閣下提供更個性化服務。阁下如不希望接受Cookies,可以修改有关互联网选项或阁下计算机系统的浏览选项,但阁下可能因此无法使用或启动本网站的若干功能。'
data/lib/gdpr/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Gdpr
2
- VERSION = '1.1.0'
2
+ VERSION = '1.2.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gdpr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arnaud Levy
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-07-30 00:00:00.000000000 Z
12
+ date: 2021-03-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
98
  requirements: []
99
- rubygems_version: 3.0.3
99
+ rubygems_version: 3.1.4
100
100
  signing_key:
101
101
  specification_version: 4
102
102
  summary: Helps getting your Rails app GDPR compliant