gdpr 1.0.12 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +23 -1
- data/app/assets/javascripts/gdpr/cookie_consent.js +84 -6
- data/app/assets/stylesheets/gdpr/cookie_consent.sass +19 -12
- data/app/views/gdpr/_cookie_consent.html.erb +9 -10
- data/config/locales/de.yml +4 -3
- data/config/locales/en.yml +4 -3
- data/config/locales/es.yml +4 -3
- data/config/locales/fr.yml +4 -3
- data/config/locales/it.yml +4 -3
- data/config/locales/oc.yml +8 -0
- data/config/locales/zh.yml +4 -3
- data/lib/gdpr/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2517f00b5266454dda4598df1366250e82ae8c63bfccabdeb6fe2d960f9f8db
|
4
|
+
data.tar.gz: 857337f5de33d1a4b1e33001b57c2a9ef94c36085e5f42a89d022f7f59cd0c06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: edcd8bd191bb95b39d74eba1739b71ca1989af0e16a6c11df52267a17929476bf21a03a68e0d3d9efc44da3e66a5e3c739f86bd35ab6d6d077df6fd6fbcf4584
|
7
|
+
data.tar.gz: 7e055b39fc8738a6dcec97ac152fe1871b19f1256c8d5f8b97ecda5e26b6a3adc6069c05b962f40ce6bbe02c14cf3a3cee12213083fec29094db6e205223fc5c
|
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,85 @@
|
|
1
|
+
/* global Cookies, gtag */
|
1
2
|
//= require js.cookie
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
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 (accepted) {
|
56
|
+
'use strict';
|
57
|
+
Cookies.set('gdpr.cookie_consent.ok', accepted, { path: '/', expires: 365 });
|
58
|
+
this.displayBanner(false);
|
59
|
+
if (accepted) {
|
60
|
+
if (typeof window.gtag !== 'undefined') {
|
61
|
+
window.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
|
+
|
78
|
+
if (document.readyState === 'complete' || document.readyState === 'interactive') {
|
79
|
+
window.cookieConsent.init();
|
80
|
+
} else {
|
81
|
+
window.addEventListener('DOMContentLoaded', function () {
|
82
|
+
'use strict';
|
83
|
+
window.cookieConsent.init();
|
84
|
+
});
|
85
|
+
}
|
@@ -1,14 +1,21 @@
|
|
1
1
|
.gdpr__cookie_consent
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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
|
-
|
14
|
-
|
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
|
-
|
2
|
-
<div class="
|
3
|
-
|
4
|
-
|
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
|
-
|
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-primary btn-sm btn-xs"> <%= t('gdpr.cookie_consent.button_ko') %></button>
|
9
|
+
</div>
|
10
|
+
</div>
|
data/config/locales/de.yml
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
de:
|
2
2
|
gdpr:
|
3
|
-
privacy_policy: https://
|
3
|
+
privacy_policy: https://gdpr.eu/cookies/
|
4
4
|
cookie_consent:
|
5
|
-
|
6
|
-
|
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."
|
data/config/locales/en.yml
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
en:
|
2
2
|
gdpr:
|
3
|
-
privacy_policy: https://
|
3
|
+
privacy_policy: https://gdpr.eu/cookies/
|
4
4
|
cookie_consent:
|
5
|
-
|
6
|
-
|
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.'
|
data/config/locales/es.yml
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
es:
|
2
2
|
gdpr:
|
3
|
-
privacy_policy: https://
|
3
|
+
privacy_policy: https://gdpr.eu/cookies/
|
4
4
|
cookie_consent:
|
5
|
-
|
6
|
-
|
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."
|
data/config/locales/fr.yml
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
fr:
|
2
2
|
gdpr:
|
3
|
-
privacy_policy: https://
|
3
|
+
privacy_policy: https://gdpr.eu/cookies/
|
4
4
|
cookie_consent:
|
5
|
-
|
6
|
-
|
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."
|
data/config/locales/it.yml
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
it:
|
2
2
|
gdpr:
|
3
|
-
privacy_policy: https://
|
3
|
+
privacy_policy: https://gdpr.eu/cookies/
|
4
4
|
cookie_consent:
|
5
|
-
|
6
|
-
|
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."
|
@@ -0,0 +1,8 @@
|
|
1
|
+
oc:
|
2
|
+
gdpr:
|
3
|
+
privacy_policy: https://gdpr.eu/cookies/
|
4
|
+
cookie_consent:
|
5
|
+
button_ko: "Refusar"
|
6
|
+
button_ok: "Validar"
|
7
|
+
learn_more_html: "Per ne saber mai e configurar aquestes cookies : <a href=\"%{link}\" target=\"_blank\">cliquer ici</a>."
|
8
|
+
text: "En contunhant la navigation sus aqueste site, acceptatz l’utilizacion de cookies per vos prepausar especialament de foncionalitats personalizadas e per realizar de mesurea d’audiéncia."
|
data/config/locales/zh.yml
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
zh:
|
2
2
|
gdpr:
|
3
|
-
privacy_policy: https://
|
3
|
+
privacy_policy: https://gdpr.eu/cookies/
|
4
4
|
cookie_consent:
|
5
|
-
|
6
|
-
|
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
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gdpr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arnaud Levy
|
8
8
|
- Pierre-André Boissinot
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-02-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -72,6 +72,7 @@ files:
|
|
72
72
|
- config/locales/es.yml
|
73
73
|
- config/locales/fr.yml
|
74
74
|
- config/locales/it.yml
|
75
|
+
- config/locales/oc.yml
|
75
76
|
- config/locales/zh.yml
|
76
77
|
- lib/gdpr.rb
|
77
78
|
- lib/gdpr/engine.rb
|
@@ -81,7 +82,7 @@ homepage: https://github.com/lespoupeesrusses/gdpr
|
|
81
82
|
licenses:
|
82
83
|
- MIT
|
83
84
|
metadata: {}
|
84
|
-
post_install_message:
|
85
|
+
post_install_message:
|
85
86
|
rdoc_options: []
|
86
87
|
require_paths:
|
87
88
|
- lib
|
@@ -96,9 +97,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
97
|
- !ruby/object:Gem::Version
|
97
98
|
version: '0'
|
98
99
|
requirements: []
|
99
|
-
|
100
|
-
|
101
|
-
signing_key:
|
100
|
+
rubygems_version: 3.1.6
|
101
|
+
signing_key:
|
102
102
|
specification_version: 4
|
103
103
|
summary: Helps getting your Rails app GDPR compliant
|
104
104
|
test_files: []
|