cookies_eu 1.7.4 → 1.7.8

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: 21c2f8a5f27fa8ab770c3be110887798644f17cd9a239fad25c2b92e7aa66f8c
4
- data.tar.gz: 2c38d7762ab9419852746965ceb6267fbae8046386cbf2471ef5ef167675ac06
3
+ metadata.gz: ef0d89db9e2357389f70112e9a4297b66425c05f650388b0faad52ac093bdc95
4
+ data.tar.gz: 1c4ad2c16def8a1c133fd43bae71ab719e35adb979307047fd7b9ad392844892
5
5
  SHA512:
6
- metadata.gz: 504941b367fac69fe25c180ffff1d179bb655159aa613adedc2a3afbbe452c661a715e0825806d9eb835f4394b18599415b92dcdb4d4b66eb97560294bc2d231
7
- data.tar.gz: 57a32e1243c5537f3a9df7cc8dbde9c116c0bedc890a4fa1b7945e20dcb4d5eaae952111b8b31b07d220e6c42e6dedce016d5067c72df90b6bad7e6b7b7ed886
6
+ metadata.gz: dc9a1a68a0199e56fe4c7c8af2a0e7a39cb9b0f558280d2c972aa65080901a1de9f97622aab838aae99c5a797b7c53c07ea0f6d8a947752588ecd1f6b37a4b53
7
+ data.tar.gz: d3d46d5e74e8eab57e1cb670a81503ad42213d3540d0766832f2116a085564f749254ca06bb9f79e1a8366c768174caee59072d99671283572cc481a1ae2ad10
data/README.md CHANGED
@@ -8,6 +8,7 @@ Gem to add cookie consent to rails application
8
8
 
9
9
  * Albanian
10
10
  * Basque
11
+ * Bulgarian
11
12
  * Catalan
12
13
  * Croatian
13
14
  * Czech
@@ -19,8 +20,10 @@ Gem to add cookie consent to rails application
19
20
  * French
20
21
  * German
21
22
  * Greek
23
+ * Hebrew
22
24
  * Hungarian
23
25
  * Italian
26
+ * Lithuanian
24
27
  * Norwegian
25
28
  * Polish
26
29
  * Portuguese
@@ -29,8 +32,13 @@ Gem to add cookie consent to rails application
29
32
  * Slovenian
30
33
  * Spanish
31
34
  * Swedish
35
+ * Turkish
32
36
  * Ukrainian
33
37
 
38
+ ## Screenshot
39
+
40
+ ![Cookies eu screenshot](https://user-images.githubusercontent.com/2737390/86209657-5a5e8b00-bb73-11ea-91fc-e5ff36af148f.png)
41
+
34
42
  ## Installation
35
43
 
36
44
  Add this line to your application's Gemfile:
@@ -91,6 +99,18 @@ If you wish to customize the style of the div the classes are:
91
99
  .cookies-eu-link /* link */
92
100
  ```
93
101
 
102
+ If you wish to customize the HTML, create a folder `cookies_eu`, create a partial `_consent_banner.html.erb` and paste the HTML from [here](app/views/cookies_eu/_consent_banner.html.erb)
103
+
104
+ If you wish to run some arbitrary code when the user acknowledges the cookie message, you can register a callback. This is useful if you wish to persist the user's preference to the database.
105
+
106
+ ```javascript
107
+ document.addEventListener('cookies-eu-acknowledged', function() {
108
+ // The user has acknowledged cookies! If they're logged in, make an api call
109
+ // so we remember their preference.
110
+ fetch('...');
111
+ });
112
+ ```
113
+
94
114
  ## Cookies used
95
115
 
96
116
  This gem uses a cookie called **cookie_eu_consented** to track whether a user has accepted the cookie notice and whether it needs to be shown again or not.
@@ -24,10 +24,13 @@ var cookiesEu = {
24
24
  },
25
25
 
26
26
  setCookie: function() {
27
- Cookies.set('cookie_eu_consented', true, { path: '/', expires: 365 });
27
+ var isSecure = location.protocol === 'https:';
28
+ Cookies.set('cookie_eu_consented', true, { path: '/', expires: 365, secure: isSecure });
28
29
 
29
30
  var container = document.querySelector('.js-cookies-eu');
30
31
  container.parentNode.removeChild(container);
32
+
33
+ document.dispatchEvent(new CustomEvent('cookies-eu-acknowledged'));
31
34
  }
32
35
  };
33
36
 
@@ -1,11 +1,15 @@
1
- <% if cookies && cookies['cookie_eu_consented'] != 'true' %>
2
- <div class="cookies-eu js-cookies-eu">
3
- <span class="cookies-eu-content-holder"><%= t('cookies_eu.cookies_text') %></span>
4
- <span class="cookies-eu-button-holder">
5
- <button class="cookies-eu-ok js-cookies-eu-ok"> <%= t('cookies_eu.ok') %> </button>
6
- <% if defined?(link).present? %>
7
- <a href="<%= link %>" class="cookies-eu-link" target="<%= defined?(target).present? ? target : '' %>"> <%= t('cookies_eu.learn_more') %> </a>
8
- <% end %>
9
- </span>
10
- </div>
1
+ <% if cookies.kind_of? ActionDispatch::Cookies::CookieJar %>
2
+ <% if cookies && cookies['cookie_eu_consented'] != 'true' %>
3
+ <div class="cookies-eu js-cookies-eu" <%= "dir=rtl" if I18n.exists?('cookies_eu.direction', I18n.locale) && I18n.t("cookies_eu.direction") == "rtl" %>>
4
+ <span class="cookies-eu-content-holder"><%= t('cookies_eu.cookies_text') %></span>
5
+ <span class="cookies-eu-button-holder">
6
+ <button class="cookies-eu-ok js-cookies-eu-ok"> <%= t('cookies_eu.ok') %> </button>
7
+ <% if defined?(link).present? %>
8
+ <a href="<%= link %>" class="cookies-eu-link" target="<%= defined?(target).present? ? target : '' %>"> <%= t('cookies_eu.learn_more') %> </a>
9
+ <% end %>
10
+ </span>
11
+ </div>
12
+ <% end %>
13
+ <% else %>
14
+ <% raise Exception.new "'cookies' is a reserved Rails class, please rename your method" %>
11
15
  <% end %>
@@ -0,0 +1,5 @@
1
+ bg:
2
+ cookies_eu:
3
+ cookies_text: "Курабийките ни помагат да доставяме услугите си. Използвайки нашите услуги, вие се съгласявате с нашето използване на курабийки."
4
+ learn_more: "Научи повече"
5
+ ok: "ОК"
@@ -1,5 +1,5 @@
1
1
  el:
2
2
  cookies_eu:
3
- cookies_text: "Τα cookies μας βοηθούν να προσφέρουμε τις υπηρεσίες μας. Με την χρησιμοποίηση των υπηρεσιών μας, συμφωνείτε στην χρήση των cookies."
3
+ cookies_text: "Τα cookies μας βοηθούν να προσφέρουμε τις υπηρεσίες μας. Με την χρήση των υπηρεσιών μας, συμφωνείτε στην χρήση των cookies."
4
4
  learn_more: "Μάθετε περισσότερα"
5
5
  ok: "OK"
@@ -0,0 +1,6 @@
1
+ he:
2
+ cookies_eu:
3
+ cookies_text: "העוגיות עוזרות לנו לספק את שירותינו. על ידי השימוש בשירותים שלנו אתה מסכים לשימוש שלנו בעוגיות."
4
+ learn_more: "למד/י עוד"
5
+ ok: "בסדר"
6
+ direction: "rtl"
@@ -0,0 +1,5 @@
1
+ lt:
2
+ cookies_eu:
3
+ cookies_text: "Sklandžiam svetainės veikimui, jūsų naršymo patirties gerinimui bei rinkodarai naudojame slapukus. Spausdami sutinku ar toliau naršydami svetainėje, Jūs sutinkate su slapukų įrašymu."
4
+ learn_more: "Daugiau informacijos"
5
+ ok: "OK"
@@ -0,0 +1,5 @@
1
+ tr:
2
+ cookies_eu:
3
+ cookies_text: "Çerezler, hizmetlerimizi sunmamıza yardımcı oluyor. Hizmetlerimizi kullanarak, çerez kullanımımızı kabul etmiş olursunuz. "
4
+ learn_more: "Detayları Göster"
5
+ ok: "Tamam"
data/cookies_eu.gemspec CHANGED
@@ -6,8 +6,8 @@ require 'cookies_eu/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "cookies_eu"
8
8
  spec.version = CookiesEu::VERSION
9
- spec.authors = ["Stjepan Hadjic"]
10
- spec.email = ["stjepan.hadjic@infinum.hr"]
9
+ spec.authors = ["Stjepan Hadjic", "Gabrijel Skoro"]
10
+ spec.email = ["stjepan.hadjic@infinum.hr", "gabrijel.skoro@gmail.com"]
11
11
  spec.description = %q{Displays a cookie consent}
12
12
  spec.summary = %q{Displays a cookie consent. If you dont disable cokkies in settings, we assume you are ok with us using cookies}
13
13
  spec.homepage = "https://github.com/infinum/cookies_eu"
@@ -1,3 +1,3 @@
1
1
  module CookiesEu
2
- VERSION = "1.7.4"
2
+ VERSION = "1.7.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cookies_eu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.4
4
+ version: 1.7.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stjepan Hadjic
8
+ - Gabrijel Skoro
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2019-01-04 00:00:00.000000000 Z
12
+ date: 2021-07-31 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: js_cookie_rails
@@ -55,6 +56,7 @@ dependencies:
55
56
  description: Displays a cookie consent
56
57
  email:
57
58
  - stjepan.hadjic@infinum.hr
59
+ - gabrijel.skoro@gmail.com
58
60
  executables: []
59
61
  extensions: []
60
62
  extra_rdoc_files: []
@@ -69,6 +71,7 @@ files:
69
71
  - app/assets/stylesheets/cookies_eu.scss
70
72
  - app/views/cookies_eu/_consent_banner.html.erb
71
73
  - app/views/cookies_eu/cookies_info.html.haml
74
+ - config/locales/bg.yml
72
75
  - config/locales/ca.yml
73
76
  - config/locales/cs.yml
74
77
  - config/locales/da.yml
@@ -80,9 +83,11 @@ files:
80
83
  - config/locales/eu.yml
81
84
  - config/locales/fi.yml
82
85
  - config/locales/fr.yml
86
+ - config/locales/he.yml
83
87
  - config/locales/hr.yml
84
88
  - config/locales/hu.yml
85
89
  - config/locales/it.yml
90
+ - config/locales/lt.yml
86
91
  - config/locales/nl.yml
87
92
  - config/locales/no.yml
88
93
  - config/locales/pl.yml
@@ -93,6 +98,7 @@ files:
93
98
  - config/locales/sl.yml
94
99
  - config/locales/sq.yml
95
100
  - config/locales/sv.yml
101
+ - config/locales/tr.yml
96
102
  - config/locales/ua.yml
97
103
  - cookies_eu.gemspec
98
104
  - lib/cookies_eu.rb
@@ -118,8 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
124
  - !ruby/object:Gem::Version
119
125
  version: '0'
120
126
  requirements: []
121
- rubyforge_project:
122
- rubygems_version: 2.7.3
127
+ rubygems_version: 3.1.4
123
128
  signing_key:
124
129
  specification_version: 4
125
130
  summary: Displays a cookie consent. If you dont disable cokkies in settings, we assume