cookei 0.2.4 → 0.2.11

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: 6c30540b8b626482ec9d1a6067cb2b96abb108d0cc4f9437ff5068e833719452
4
- data.tar.gz: ed1141543ed41e304d9108fd578e4e764e761ca81a72ece0cdca7ef772731fe4
3
+ metadata.gz: c335881555621d5b350e274466157c64c286e23ea89f8b1c736d29c47ab11059
4
+ data.tar.gz: b9860fd632880460f32bdc185e088c9a8be290c74be7839e4fe39340826c83b3
5
5
  SHA512:
6
- metadata.gz: 99402979b678191054a541b9593bae41547257a062ace71ac7757d0dcfb7a2ff2700baccfe371f7ac4a3cdbbac2b69338244f68a0709701d9a85fdfd96955910
7
- data.tar.gz: e9c3b87c11ab36bb330533b7fb4f344fc13ea9a3570f87bbb0d7d42f272e9eaae0ecfbd2c322114ab471ff56ac73409890ec9053c0e1af02c8480146b3fe3389
6
+ metadata.gz: eff2480526cf414aae6d94de86773fbe7ce9143708589aa5a22957fe29c888b9b3b98eee4df9ebf83d0374abc2e5bb6b9ef66454812b651c3ab255be437c117c
7
+ data.tar.gz: 50753b706b3149c29ce8d2dc26afba672d3117bfe1f7228dec1bbece46f983f847a471597247726f0b669a6eb450622792006ef27a119a05bd3295d36a782e47
@@ -430,4 +430,129 @@
430
430
  }
431
431
  }
432
432
  }
433
- }
433
+ }
434
+
435
+ #cookei_disclaimer {
436
+ .modal-container {
437
+ display: none;
438
+ position: fixed;
439
+ padding-top: 24px;
440
+ top: 0;
441
+ height: 100%;
442
+ background-color: rgba(0, 0, 0, 0.8);
443
+ max-width: 100%;
444
+ z-index: 101;
445
+ overflow-y: scroll;
446
+
447
+ div {
448
+ padding: 0;
449
+ }
450
+
451
+ .content-modal {
452
+ position: absolute;
453
+ top: 10%;
454
+ left: 50%;
455
+ margin-left: -380px;
456
+ width:760px;
457
+ padding: 25px;
458
+
459
+ background-color: #fefefe;
460
+ -webkit-border-radius: 6px;
461
+ -moz-border-radius: 6px;
462
+ border-radius: 6px;
463
+
464
+ form {
465
+ display: block;
466
+ }
467
+
468
+ .content-between {
469
+ display: -ms-flexbox;
470
+ display: flex;
471
+ -ms-flex-pack: justify;
472
+ justify-content: space-between;
473
+ }
474
+
475
+ input[type=checkbox] {
476
+ &:checked+.checkbox {
477
+ background: #ffc4b9;
478
+
479
+ &:after {
480
+ content: 'On';
481
+ left: 28px;
482
+ }
483
+ }
484
+
485
+ &:disabled+.checkbox {
486
+ opacity: 0.8;
487
+ cursor: default;
488
+ background: #cecece;
489
+ }
490
+ }
491
+
492
+ label {
493
+ .checkbox {
494
+ font-size: 0;
495
+ cursor: pointer;
496
+ width: 60px;
497
+ height: 24px;
498
+ background: #777;
499
+ border-radius: 24px;
500
+
501
+ &:after {
502
+ content: 'Off';
503
+ text-align: center;
504
+ position: absolute;
505
+ font-size: 11px;
506
+ top: 2px;
507
+ right: 3px;
508
+ width: 33px;
509
+ height: 20px;
510
+ line-height: 20px;
511
+ background: #fff;
512
+ border-radius: 46px;
513
+ transition: 0.3s;
514
+ }
515
+
516
+ &:hover {
517
+ opacity: 0.8;
518
+ }
519
+ }
520
+
521
+ &:hover {
522
+ opacity: 1;
523
+ cursor: default;
524
+ }
525
+ }
526
+ }
527
+ }
528
+ }
529
+
530
+
531
+ #cookei_disclaimer.blue {
532
+ .content-modal {
533
+ color: #121e40;
534
+ h4 {
535
+ font-weight: normal;
536
+ margin-bottom: 30px;
537
+ }
538
+
539
+ input[type=checkbox] {
540
+ &:checked+.checkbox {
541
+ background: #63d3f4;
542
+ }
543
+
544
+ &:disabled+.checkbox {
545
+ opacity: 0.8;
546
+ cursor: default;
547
+ background: #cecece;
548
+ }
549
+ }
550
+
551
+ .submit {
552
+ input {
553
+ color: #777;
554
+ border-color: #777;
555
+ }
556
+ }
557
+ }
558
+ }
@@ -32,7 +32,7 @@
32
32
 
33
33
  <%- COOKEI_ENABLED_TRACKERS.each do |key, value| %>
34
34
  <%- value.each do |tracker| %>
35
- <%- next unless session[tracker] %>
35
+ <%- next unless (session[tracker] == true || session[tracker].try(:to_i) == 1) %>
36
36
  <%= render "cookei/tracking/#{key}/#{tracker}" %>
37
37
  <%- end %>
38
38
  <%- end %>
@@ -0,0 +1,24 @@
1
+ <%- unless session[:tracking_settings_set] %>
2
+ <div id="cookei_disclaimer" class="<%= COOKEI_STYLE %> <%= COOKEI_POSITION %>">
3
+ <div>
4
+ <%= t('cookei.disclaimer.text_html') %>
5
+ <%= link_to t('cookei.disclaimer.read_more'), COOKEI_POLICY_URL %>
6
+ <%= link_to t('cookei.disclaimer.settings'), '#', id: 'myBtn', data: { toggle: "modal" } %>
7
+
8
+ <%= form_with(url: cookei.api_v1_cookies_path, method: :post, data: { remote: true }) do |f| %>
9
+ <div class="submit">
10
+ <%= f.submit 'Hyväksy kaikki', name: 'all' %>
11
+ </div>
12
+ <%- end %>
13
+ </div>
14
+
15
+ <%= render 'cookei/api/v2/cookies/modal'%>
16
+ </div>
17
+ <%- end %>
18
+
19
+ <%- COOKEI_ENABLED_TRACKERS.each do |key, value| %>
20
+ <%- value.each do |tracker| %>
21
+ <%- next unless (session[tracker] == true || session[tracker].try(:to_i) == 1) %>
22
+ <%= render "cookei/tracking/#{key}/#{tracker}" %>
23
+ <%- end %>
24
+ <%- end %>
@@ -0,0 +1,23 @@
1
+ #cookie-modal.modal-container
2
+ .content-modal
3
+ = form_with(url: cookei.api_v1_cookies_path, method: :post, data: { remote: true }) do |f|
4
+ .content-between
5
+ %h4 Ehdottomasti tarpeelliset evästeet
6
+ = f.label :required do
7
+ = f.check_box :required, value: '1', checked: 'checked', disabled: true
8
+ .checkbox
9
+
10
+ .content-between
11
+ %h4 Analyysiin ja suorituskykyyn liittyvät evästeet
12
+ = f.label :statistics do
13
+ = f.check_box :statistics, value: '1'
14
+ .checkbox
15
+
16
+ .content-between
17
+ %h4 Kohdistamis- ja mainontaevästeet
18
+ = f.label :targeting do
19
+ = f.check_box :targeting, value: '1'
20
+ .checkbox
21
+
22
+ .submit
23
+ = f.submit 'Hyväksy valittu', name: 'selected'
@@ -1,7 +1,7 @@
1
1
  COOKEI_ENABLED_TRACKERS = {
2
2
  required: [],
3
3
  preferences: [],
4
- statistics: [:google_analytics ],
4
+ statistics: [:google_analytics],
5
5
  marketing: [:google_adsense]
6
6
  }
7
7
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cookei
4
- VERSION = '0.2.4'
4
+ VERSION = '0.2.11'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cookei
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artis Raugulis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-08 00:00:00.000000000 Z
11
+ date: 2020-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: haml
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rspec
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -113,6 +127,8 @@ files:
113
127
  - app/models/cookei/application_record.rb
114
128
  - app/views/cookei/api/v1/cookies/_disclaimer.html.erb
115
129
  - app/views/cookei/api/v1/cookies/create.js.erb
130
+ - app/views/cookei/api/v2/cookies/_disclaimer.html.erb
131
+ - app/views/cookei/api/v2/cookies/_modal.html.haml
116
132
  - app/views/cookei/tracking/marketing/_google_adsense.html.erb
117
133
  - app/views/cookei/tracking/statistics/_google_analytics.html.erb
118
134
  - app/views/layouts/cookei/application.html.erb
@@ -137,7 +153,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
137
153
  requirements:
138
154
  - - ">="
139
155
  - !ruby/object:Gem::Version
140
- version: 2.7.0
156
+ version: 2.6.5
141
157
  required_rubygems_version: !ruby/object:Gem::Requirement
142
158
  requirements:
143
159
  - - ">="