immosquare-cookies 0.1.6 → 0.1.8
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/app/assets/stylesheets/immosquare-cookies.scss +99 -89
- data/app/views/immosquare-cookies/_consent_banner.html.erb +37 -22
- data/config/locales/immosquare-cookies.en.yml +5 -2
- data/config/locales/immosquare-cookies.es.yml +4 -1
- data/config/locales/immosquare-cookies.fr.yml +5 -2
- data/config/locales/immosquare-cookies.it.yml +4 -1
- data/config/locales/immosquare-cookies.nl.yml +3 -1
- data/config/locales/immosquare-cookies.zh-TW.yml +9 -0
- data/config/locales/immosquare-cookies.zh.yml +3 -1
- data/lib/immosquare-cookies/version.rb +1 -1
- metadata +6 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7eb6e162ff2d90f082a12dc39014623c9420dfd1293638d9fb548ec9377a1ffa
|
4
|
+
data.tar.gz: f00cd0502e661094343daa7ce43784abce66a46159349974c38ac50096058f4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ed07ec0cc51429ece1d25230e2d1c3930e4a1a9f3d64b75742e8a549a71dab9c07ff2fa0427173d87c96b70087031ca1e8dfdc09814d750bda7c209772b473b
|
7
|
+
data.tar.gz: a659701fda2b99a631ad8ed753cb028b4330a45848b4cd0bb016284edca020abf5ac591aed473d44a452134c0709ed273b88d5f3ac0846763aa1357a4a24b1de
|
@@ -1,104 +1,114 @@
|
|
1
1
|
#immosquare-cookies-container {
|
2
|
-
--
|
3
|
-
--immosquare-cookies-
|
4
|
-
--immosquare-cookies-
|
5
|
-
--immosquare-cookies-
|
6
|
-
--immosquare-cookies-
|
2
|
+
--immosquare-cookies-color: #004b99;
|
3
|
+
--immosquare-cookies-bg: #f8f9fa;
|
4
|
+
--immosquare-cookies-border: #dee2e6;
|
5
|
+
--immosquare-cookies-text: #6c757d;
|
6
|
+
--immosquare-cookies-primary: #0d6efd;
|
7
|
+
--immosquare-cookies-secondary: #6c757d;
|
7
8
|
--immosquare-cookies-btn-color: white;
|
8
|
-
|
9
|
+
}
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
.immosquare-cookies-banner {
|
12
|
+
z-index: 1050 !important;
|
13
|
+
position: fixed;
|
14
|
+
bottom: 0;
|
15
|
+
left: 0;
|
16
|
+
padding: 1.5rem;
|
17
|
+
max-width: 50%;
|
18
|
+
}
|
14
19
|
|
15
|
-
|
16
|
-
|
17
|
-
|
20
|
+
.immosquare-cookies-card {
|
21
|
+
background-color: var(--immosquare-cookies-bg);
|
22
|
+
border: 1px solid var(--immosquare-cookies-border);
|
23
|
+
border-radius: 0.375rem;
|
24
|
+
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
|
25
|
+
padding: 1.5rem;
|
26
|
+
}
|
18
27
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
28
|
+
.immosquare-cookies-header {
|
29
|
+
font-weight: 600;
|
30
|
+
font-size: 1.25rem;
|
31
|
+
margin-bottom: 1rem;
|
32
|
+
color: #212529;
|
33
|
+
}
|
23
34
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
left: 0;
|
28
|
-
bottom: 0;
|
29
|
-
width: 100%;
|
30
|
-
box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
|
31
|
-
height: var(--immmosquare-cookies-height);
|
32
|
-
min-height: 200px;
|
33
|
-
color: var(--immosquare-cookies-color);
|
34
|
-
background-color: var(--immosquare-cookies-bg-color);
|
35
|
-
border-top: 1px solid var(--immosquare-cookies-border-color);
|
36
|
-
display: flex;
|
37
|
-
justify-content: center;
|
38
|
-
align-items: var(--immosquare-cookies-border-align);
|
39
|
-
padding: 1rem 3rem;
|
40
|
-
}
|
35
|
+
.immosquare-cookies-content {
|
36
|
+
margin-bottom: 1.5rem;
|
37
|
+
}
|
41
38
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
39
|
+
.immosquare-cookies-text {
|
40
|
+
color: var(--immosquare-cookies-text);
|
41
|
+
font-size: 0.875rem;
|
42
|
+
line-height: 1.5rem;
|
43
|
+
}
|
44
|
+
|
45
|
+
.immosquare-cookies-link-text {
|
46
|
+
margin-right: 0.25rem;
|
47
|
+
}
|
48
|
+
|
49
|
+
.immosquare-cookies-link-separator {
|
50
|
+
margin: 0 0.25rem;
|
51
|
+
}
|
52
|
+
|
53
|
+
.immosquare-cookies-link {
|
54
|
+
color: var(--immosquare-cookies-color);
|
55
|
+
text-decoration: none;
|
56
|
+
font-weight: 700;
|
57
|
+
|
58
|
+
&:hover {
|
59
|
+
color: darken(#004b99, 10%);
|
48
60
|
text-decoration: underline;
|
49
|
-
cursor: pointer;
|
50
|
-
&:hover {
|
51
|
-
animation: immosquare-cookies-effect 0.5s 1;
|
52
|
-
}
|
53
61
|
}
|
54
|
-
|
55
|
-
|
62
|
+
}
|
63
|
+
|
64
|
+
.immosquare-cookies-actions {
|
65
|
+
display: flex;
|
66
|
+
gap: 0.5rem;
|
67
|
+
justify-content: flex-end;
|
68
|
+
}
|
69
|
+
|
70
|
+
.immosquare-cookies-btn {
|
71
|
+
color: var(--immosquare-cookies-btn-color);
|
72
|
+
background-color: var(--immosquare-cookies-color);
|
73
|
+
border: 1px solid var(--immosquare-cookies-color);
|
74
|
+
display: inline-block;
|
75
|
+
font-weight: 400;
|
76
|
+
line-height: 1.5;
|
77
|
+
text-align: center;
|
78
|
+
text-decoration: none;
|
79
|
+
vertical-align: middle;
|
80
|
+
cursor: pointer;
|
81
|
+
user-select: none;
|
82
|
+
padding: 0.5rem 0.75rem;
|
83
|
+
font-size: 0.875rem;
|
84
|
+
border-radius: 0.25rem;
|
85
|
+
transition:
|
86
|
+
color 0.15s ease-in-out,
|
87
|
+
background-color 0.15s ease-in-out,
|
88
|
+
border-color 0.15s ease-in-out,
|
89
|
+
box-shadow 0.15s ease-in-out;
|
90
|
+
|
91
|
+
&:hover {
|
92
|
+
background-color: darken(#004b99, 10%);
|
93
|
+
border-color: darken(#004b99, 10%);
|
56
94
|
color: var(--immosquare-cookies-btn-color);
|
57
|
-
|
58
|
-
border-radius: 2rem;
|
59
|
-
cursor: pointer;
|
60
|
-
padding: 20px;
|
61
|
-
&:hover {
|
62
|
-
animation: immosquare-cookies-effect 0.5s 1;
|
63
|
-
}
|
64
|
-
}
|
65
|
-
#immosquare-cookies-actions {
|
66
|
-
margin-top: 20px;
|
67
|
-
margin-bottom: 20px;
|
68
|
-
display: flex;
|
69
|
-
justify-content: center;
|
70
|
-
align-items: center;
|
71
|
-
gap: 20px;
|
95
|
+
text-decoration: none;
|
72
96
|
}
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
overflow-y: auto;
|
78
|
-
}
|
79
|
-
@media (max-width: 575.98px) {
|
80
|
-
section {
|
81
|
-
max-width: none;
|
82
|
-
}
|
83
|
-
}
|
84
|
-
@media (min-width: 576px) and (max-width: 767.98px) {
|
85
|
-
section {
|
86
|
-
max-width: 540px;
|
87
|
-
}
|
88
|
-
}
|
89
|
-
@media (min-width: 768px) and (max-width: 991.98px) {
|
90
|
-
section {
|
91
|
-
max-width: 720px;
|
92
|
-
}
|
97
|
+
|
98
|
+
&:focus {
|
99
|
+
outline: 0;
|
100
|
+
box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
|
93
101
|
}
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
102
|
+
}
|
103
|
+
|
104
|
+
// Responsive design
|
105
|
+
@media (max-width: 768px) {
|
106
|
+
.immosquare-cookies-banner {
|
107
|
+
max-width: 100%;
|
108
|
+
padding: 1rem;
|
98
109
|
}
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
}
|
110
|
+
|
111
|
+
.immosquare-cookies-card {
|
112
|
+
padding: 1rem;
|
103
113
|
}
|
104
114
|
}
|
@@ -1,34 +1,49 @@
|
|
1
|
-
<%
|
1
|
+
<%
|
2
|
+
cookie_name = defined?(key) ? key : "_immosquare_consented"
|
3
|
+
duration_months = defined?(duration_months) && duration_months.to_i.between?(1, 12) ? duration_months.to_i : 6
|
4
|
+
%>
|
2
5
|
|
3
|
-
<%# DIV %>
|
4
6
|
<%= content_tag(:div, :id => "immosquare-cookies-container", :data => {:name => cookie_name}) do %>
|
5
|
-
<
|
6
|
-
|
7
|
-
|
7
|
+
<div class="immosquare-cookies-banner">
|
8
|
+
<div class="immosquare-cookies-card">
|
9
|
+
<%# Header %>
|
10
|
+
<%= content_tag(:div, t("immosquare-cookies.document_title", :site_name => defined?(site_name) ? site_name : request.host), :class => "immosquare-cookies-header") %>
|
8
11
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
12
|
+
<%# Content %>
|
13
|
+
<div class="immosquare-cookies-content">
|
14
|
+
<div class="immosquare-cookies-text">
|
15
|
+
<%= content_tag(:div, (defined?(text).present? ? text : t("immosquare-cookies.text", :duration_months => duration_months)).html_safe) %>
|
16
|
+
<% if defined?(link) %>
|
17
|
+
<%# Backward compatibility with the :link parameter %>
|
18
|
+
<%= content_tag(:span, defined?(link_text) ? link_text : t("immosquare-cookies.link_text"), :class => "immosquare-cookies-link-text") %>
|
19
|
+
<%= link_to(defined?(document_name) ? document_name : t("immosquare-cookies.document_name"), link, :target => defined?(target) ? target : "_blank", :class => "immosquare-cookies-link") %>
|
20
|
+
|
21
|
+
<% elsif defined?(privacy_policy_link) || defined?(cookie_policy_link) %>
|
22
|
+
<%# New parameters for the two separated links %>
|
23
|
+
<%= content_tag(:span, defined?(link_text) ? link_text : t("immosquare-cookies.link_text"), :class => "immosquare-cookies-link-text") %>
|
24
|
+
<%= link_to(defined?(privacy_policy) ? privacy_policy : t("immosquare-cookies.privacy_policy"), privacy_policy_link, :target => defined?(target) ? target : "_blank", :class => "immosquare-cookies-link") if defined?(privacy_policy_link) %>
|
25
|
+
<%= link_to(defined?(cookie_policy) ? cookie_policy : t("immosquare-cookies.cookie_policy"), cookie_policy_link, :target => defined?(target) ? target : "_blank", :class => "immosquare-cookies-link") if defined?(cookie_policy_link) %>
|
26
|
+
<% end %>
|
27
|
+
</div>
|
28
|
+
</div>
|
14
29
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
<%= link_to(defined?(document_name) ? document_name : t("immosquare-cookies.document_name"), link, :target => defined?(target) ? target : "_blank") %>
|
21
|
-
<% end %>
|
30
|
+
<%# Actions %>
|
31
|
+
<div class="immosquare-cookies-actions">
|
32
|
+
<%= content_tag(:button, defined?(refuse) ? refuse : t("immosquare-cookies.refuse"), :type => "button", :id => "immosquare-cookies-refuse", :class => "immosquare-cookies-btn") %>
|
33
|
+
<%= content_tag(:button, defined?(accept) ? accept : t("immosquare-cookies.accept"), :type => "button", :id => "immosquare-cookies-accept", :class => "immosquare-cookies-btn") %>
|
34
|
+
</div>
|
22
35
|
</div>
|
23
|
-
</
|
36
|
+
</div>
|
37
|
+
|
24
38
|
<script>
|
25
39
|
document.addEventListener("DOMContentLoaded", function() {
|
26
|
-
const cookieContainer
|
27
|
-
const cookieName
|
28
|
-
const
|
40
|
+
const cookieContainer = document.getElementById("immosquare-cookies-container");
|
41
|
+
const cookieName = cookieContainer.dataset.name;
|
42
|
+
const cookieDurationMonths = <%= duration_months %>;
|
43
|
+
const handleCookieConsent = (consentGiven) => {
|
29
44
|
cookieContainer.style.display = "none";
|
30
45
|
const date = new Date();
|
31
|
-
date.setTime(date.getTime() + (
|
46
|
+
date.setTime(date.getTime() + (cookieDurationMonths * 30 * 24 * 60 * 60 * 1000));
|
32
47
|
const expires = `;expires=${date.toUTCString()}`;
|
33
48
|
if(!consentGiven){
|
34
49
|
document.cookie.split(";").forEach(function(c) { document.cookie = c.replace(/^ +/, "").replace(/=.*/, "=;expires=" + new Date().toUTCString() + ";path=/"); });
|
@@ -1,7 +1,10 @@
|
|
1
|
-
|
1
|
+
n:
|
2
2
|
immosquare-cookies:
|
3
3
|
accept: Accept
|
4
|
+
cookie_policy: Cookie Policy.
|
4
5
|
document_name: Privacy Policy.
|
6
|
+
document_title: About cookies on %{site_name}
|
5
7
|
link_text: "More information:"
|
8
|
+
privacy_policy: Privacy Policy.
|
6
9
|
refuse: Decline
|
7
|
-
text:
|
10
|
+
text: Welcome! This site uses cookies to measure site traffic in order to improve its operation and administration and, with your consent, to evaluate performance and improve your user experience. We keep your choice for %{duration_months} months.
|
@@ -1,7 +1,10 @@
|
|
1
1
|
es:
|
2
2
|
immosquare-cookies:
|
3
3
|
accept: Aceptar
|
4
|
+
cookie_policy: Política de cookies.
|
4
5
|
document_name: Política de privacidad.
|
6
|
+
document_title: Sobre cookies en %{site_name}
|
5
7
|
link_text: "Más información:"
|
8
|
+
privacy_policy: Política de privacidad.
|
6
9
|
refuse: Rechazar
|
7
|
-
text:
|
10
|
+
text: ¡Bienvenido! Este sitio utiliza cookies para medir el tráfico del sitio con el fin de mejorar su funcionamiento y administración y, con su consentimiento, para evaluar el rendimiento y mejorar su experiencia de usuario. Conservamos su elección durante %{duration_months} meses.
|
@@ -1,7 +1,10 @@
|
|
1
1
|
fr:
|
2
2
|
immosquare-cookies:
|
3
3
|
accept: Accepter
|
4
|
+
cookie_policy: Politique des cookies.
|
4
5
|
document_name: Politique de confidentialité.
|
5
|
-
|
6
|
+
document_title: À propos des cookies sur %{site_name}
|
7
|
+
link_text: "Pour en savoir plus :"
|
8
|
+
privacy_policy: Politique de confidentialité.
|
6
9
|
refuse: Refuser
|
7
|
-
text:
|
10
|
+
text: Bienvenue ! Ce site utilise des cookies pour mesurer la fréquentation du site afin d'en améliorer le fonctionnement et l'administration et, avec votre accord, pour évaluer la performance et améliorer votre expérience utilisateur. Nous conservons votre choix pendant %{duration_months} mois.
|
@@ -1,7 +1,10 @@
|
|
1
1
|
it:
|
2
2
|
immosquare-cookies:
|
3
3
|
accept: Accetta
|
4
|
+
cookie_policy: Politica dei cookie.
|
4
5
|
document_name: Politica sulla privacy.
|
6
|
+
document_title: Informazioni sui cookie su %{site_name}
|
5
7
|
link_text: "Maggiori informazioni:"
|
8
|
+
privacy_policy: Politica sulla privacy.
|
6
9
|
refuse: Rifiuta
|
7
|
-
text:
|
10
|
+
text: Benvenuto! Questo sito utilizza i cookie per misurare il traffico del sito al fine di migliorarne il funzionamento e l'amministrazione e, con il tuo consenso, per valutare le prestazioni e migliorare la tua esperienza utente. Conserviamo la tua scelta per %{duration_months} mesi.
|
@@ -1,7 +1,9 @@
|
|
1
1
|
nl:
|
2
2
|
immosquare-cookies:
|
3
3
|
accept: Accepteren
|
4
|
+
cookie_policy: Cookiebeleid.
|
4
5
|
document_name: Privacybeleid.
|
6
|
+
document_title: Over cookies op %{site_name}
|
5
7
|
link_text: "Meer informatie:"
|
6
8
|
refuse: Weigeren
|
7
|
-
text:
|
9
|
+
text: Welkom! Deze site gebruikt cookies om het siteverkeer te meten om de werking en het beheer ervan te verbeteren en, met uw toestemming, om de prestaties te evalueren en uw gebruikerservaring te verbeteren. We bewaren uw keuze gedurende %{duration_months} maanden.
|
@@ -0,0 +1,9 @@
|
|
1
|
+
zh-TW:
|
2
|
+
immosquare-cookies:
|
3
|
+
accept: 同意
|
4
|
+
cookie_policy: Cookie 政策
|
5
|
+
document_name: 隱私權政策
|
6
|
+
document_title: 關於 %{site_name} 的 Cookie
|
7
|
+
link_text: 更多資訊:
|
8
|
+
refuse: 拒絕
|
9
|
+
text: 歡迎!本網站使用 Cookie 來測量網站流量,以改善其營運和管理,並在您同意的情況下,評估效能並改善您的使用者體驗。我們將您的選擇保存 %{duration_months} 個月。
|
@@ -1,7 +1,9 @@
|
|
1
1
|
zh:
|
2
2
|
immosquare-cookies:
|
3
3
|
accept: 接受
|
4
|
+
cookie_policy: Cookie 政策
|
4
5
|
document_name: 隐私政策。
|
6
|
+
document_title: 關於 %{site_name} 的 Cookie
|
5
7
|
link_text: 更多信息:
|
6
8
|
refuse: 拒绝
|
7
|
-
text:
|
9
|
+
text: 欢迎!本网站使用 cookie 来测量网站流量,以改善其运营和管理,并在您同意的情况下,评估性能并改善您的用户体验。我们将您的选择保存 %{duration_months} 个月。
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: immosquare-cookies
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
8
|
-
autorequire:
|
7
|
+
- immosquare
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies: []
|
13
12
|
description: Immosquare Cookies Consent Banner allows Rails developers to effortlessly
|
14
13
|
integrate a GDPR-compliant cookie consent prompt into their web applications. With
|
@@ -27,15 +26,15 @@ files:
|
|
27
26
|
- config/locales/immosquare-cookies.fr.yml
|
28
27
|
- config/locales/immosquare-cookies.it.yml
|
29
28
|
- config/locales/immosquare-cookies.nl.yml
|
29
|
+
- config/locales/immosquare-cookies.zh-TW.yml
|
30
30
|
- config/locales/immosquare-cookies.zh.yml
|
31
31
|
- lib/immosquare-cookies.rb
|
32
32
|
- lib/immosquare-cookies/engine.rb
|
33
33
|
- lib/immosquare-cookies/version.rb
|
34
|
-
homepage: https://github.com/
|
34
|
+
homepage: https://github.com/immosquare/immosquare-cookies
|
35
35
|
licenses:
|
36
36
|
- MIT
|
37
37
|
metadata: {}
|
38
|
-
post_install_message:
|
39
38
|
rdoc_options: []
|
40
39
|
require_paths:
|
41
40
|
- lib
|
@@ -50,8 +49,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
50
49
|
- !ruby/object:Gem::Version
|
51
50
|
version: '0'
|
52
51
|
requirements: []
|
53
|
-
rubygems_version: 3.
|
54
|
-
signing_key:
|
52
|
+
rubygems_version: 3.7.1
|
55
53
|
specification_version: 4
|
56
54
|
summary: A customizable cookie consent banner for Rails applications.
|
57
55
|
test_files: []
|