gdpr 1.0.9 → 1.2.0
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 +78 -5
- data/app/assets/stylesheets/gdpr/cookie_consent.sass +17 -28
- 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/zh.yml +4 -3
- data/lib/gdpr/version.rb +1 -1
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9e7345d5949d460c048ab970c54451c489f51193903505ec1c1237c517f4264
|
4
|
+
data.tar.gz: 70fbebfaaee16e47ff0a4833b601300db6c51a87351a4b76cc64dfffc9a70b67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
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,32 +1,21 @@
|
|
1
1
|
.gdpr__cookie_consent
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
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
|
11
13
|
|
12
|
-
|
13
|
-
|
14
|
+
a
|
15
|
+
text-decoration: underline !important
|
14
16
|
|
15
|
-
|
16
|
-
|
17
|
-
padding: 20px 160px
|
17
|
+
&__text
|
18
|
+
margin-bottom: 15px
|
18
19
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
&__buttons
|
23
|
-
position: absolute
|
24
|
-
right: 10px
|
25
|
-
top: 12px
|
26
|
-
|
27
|
-
@media only screen and (max-width : 480px)
|
28
|
-
position: initial
|
29
|
-
margin-bottom: 10px
|
30
|
-
|
31
|
-
&__ok
|
32
|
-
padding: 15px 21px 15px !important
|
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-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-danger 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
|
+
button_ko: "Verweigern"
|
6
|
+
button_ok: "Bestätigen"
|
7
|
+
learn_more_html: "Für weitere Informationen und Einstellen der Cookies : <a href=\"%{link}\" target=\"_blank\">bitte hier klicken</a>."
|
5
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."
|
6
|
-
button: "Ich habe verstanden"
|
7
|
-
learn_more_html: "Für weitere Informationen und Einstellen der Cookies : <a href=\"%{link}\" target=\"_blank\">bitte hier klicken</a>"
|
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
|
+
button_ko: "Refuse"
|
6
|
+
button_ok: "Validate"
|
7
|
+
learn_more_html: "To learn more about cookies and how to customize your cookies options: <a href=\"%{link}\" target=\"_blank\">click here</a>."
|
5
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.'
|
6
|
-
button: "I agree"
|
7
|
-
learn_more_html: "To learn more about cookies and how to customize your cookies options: <a href=\"%{link}\" target=\"_blank\">click here</a>"
|
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
|
+
button_ko: "Denegar"
|
6
|
+
button_ok: "Validar"
|
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>."
|
5
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."
|
6
|
-
button: "Entendido"
|
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>"
|
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
|
+
button_ko: "Refuser"
|
6
|
+
button_ok: "Valider"
|
7
|
+
learn_more_html: "Pour en savoir plus et paramétrer ces cookies : <a href=\"%{link}\" target=\"_blank\">cliquer ici</a>."
|
5
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."
|
6
|
-
button: "J'ai compris"
|
7
|
-
learn_more_html: "Pour en savoir plus et paramétrer ces cookies : <a href=\"%{link}\" target=\"_blank\">cliquer ici</a>"
|
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
|
+
button_ko: "Rifiutare"
|
6
|
+
button_ok: "Convalidare"
|
7
|
+
learn_more_html: "Per maggiori informazioni e per configurare i cookie: <a href=\"%{link}\" target=\"_blank\">cliccare qui</a>."
|
5
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."
|
6
|
-
button: "Ho capito"
|
7
|
-
learn_more_html: "Per maggiori informazioni e per configurare i cookie: <a href=\"%{link}\" target=\"_blank\">cliccare qui</a>"
|
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
|
+
button_ko: "拒绝"
|
6
|
+
button_ok: "证实"
|
7
|
+
learn_more_html: "<a href=\"%{link}\" target=\"_blank\">關於Cookies以及設置閣下計算機系統的瀏</a>."
|
5
8
|
text: '在瀏覽本網站之時,您同意本網站收集閣下Cookies(如有)及用於獲取配置數據以及分析上網認識的瀏覽習慣。Cookies可免除閣下每次瀏覽網站是重新登記的麻煩,並追蹤閣下喜歡的網頁主題選項,為閣下提供更個性化服務。阁下如不希望接受Cookies,可以修改有关互联网选项或阁下计算机系统的浏览选项,但阁下可能因此无法使用或启动本网站的若干功能。'
|
6
|
-
button: "同意"
|
7
|
-
learn_more_html: "<a href=\"%{link}\" target=\"_blank\">關於Cookies以及設置閣下計算機系統的瀏</a>"
|
data/lib/gdpr/version.rb
CHANGED
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.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:
|
12
|
+
date: 2021-03-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '0'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
|
-
name:
|
43
|
+
name: sassc-rails
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
46
|
- - ">="
|
@@ -96,8 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
98
|
requirements: []
|
99
|
-
|
100
|
-
rubygems_version: 2.7.6
|
99
|
+
rubygems_version: 3.1.4
|
101
100
|
signing_key:
|
102
101
|
specification_version: 4
|
103
102
|
summary: Helps getting your Rails app GDPR compliant
|