eu_cookies 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -8
- data/app/assets/stylesheets/eu_cookies/_variables.scss +4 -5
- data/app/assets/stylesheets/eu_cookies/style.css.scss +12 -7
- data/app/helpers/eu_cookies_helper.rb +5 -1
- data/app/views/eu_cookies/_cookies_bar.html.erb +8 -5
- data/lib/eu_cookies/version.rb +1 -1
- data/lib/generators/eu_cookies/install/templates/eu_cookies.scss +4 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fa48eb9dac60abf79394dc56ecc86f61c431c3f
|
4
|
+
data.tar.gz: f85fb2bca6de16291aaa8c4d36a22dadcdf14d09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed3a6760164fd7ceace7a831d31ec8f0231bb1e1a0df77b80cebd5aa8e2e0d485240ce370a473ad468380847924bbd24162161efd6b06b050e08ad44bb51939d
|
7
|
+
data.tar.gz: fc8f4f919052b087a815e19221e80c6b82f8e6e5c96976bce55eb3a1b13d250c27c887d32f8fdf6cc2e40a78f7df240e40c036173fbe8901bea5b16b3c04ed68
|
data/README.md
CHANGED
@@ -2,8 +2,7 @@
|
|
2
2
|
|
3
3
|
A Rails solution to the European Cookie Law issue.
|
4
4
|
|
5
|
-
This will add a dismissable "cookies bar" and a
|
6
|
-
long cookies policy text.
|
5
|
+
This will add a dismissable "cookies bar" and an optional link to a policy page.
|
7
6
|
|
8
7
|
[![Build Status](https://travis-ci.org/freego/eu_cookies.svg)](https://travis-ci.org/freego/eu_cookies)
|
9
8
|
[![Code Climate](https://codeclimate.com/github/freego/eu_cookies/badges/gpa.svg)](https://codeclimate.com/github/freego/eu_cookies)
|
@@ -13,7 +12,7 @@ long cookies policy text.
|
|
13
12
|
Add this line to your application's Gemfile:
|
14
13
|
|
15
14
|
```ruby
|
16
|
-
gem 'eu_cookies', "~> 1.0"
|
15
|
+
gem 'eu_cookies', "~> 1.1.0"
|
17
16
|
```
|
18
17
|
|
19
18
|
And then execute:
|
@@ -34,12 +33,15 @@ NOTE: This gem imply that you have JQuery.
|
|
34
33
|
|
35
34
|
## Configuration
|
36
35
|
|
37
|
-
On a initializer you can configure things (defaults are shown here):
|
36
|
+
On a initializer you can configure some things (defaults are shown here):
|
38
37
|
|
39
38
|
```ruby
|
40
|
-
|
41
|
-
EuCookies.display_policy = true
|
42
|
-
|
39
|
+
# false to remove the default internal link, a string to link an external page
|
40
|
+
EuCookies.display_policy = true
|
41
|
+
# true to treat page scroll as acceptance
|
42
|
+
EuCookies.use_scroll = false
|
43
|
+
# false to disable all the features
|
44
|
+
EuCookies.enabled = true
|
43
45
|
```
|
44
46
|
|
45
47
|
## Styling
|
@@ -49,9 +51,11 @@ take a look to your `app/assets/stylesheets/eu_cookies.scss` file.
|
|
49
51
|
|
50
52
|
## Supported languages
|
51
53
|
|
52
|
-
The
|
54
|
+
The cookies bar message is available in English, Croatian, Dutch, Estonian,
|
53
55
|
French, German, Italian, Norwegian, Polish, Russian, Slovenian, Spanish and Swedish.
|
54
56
|
|
57
|
+
The full policy page is currently in english.
|
58
|
+
|
55
59
|
## Turbolinks
|
56
60
|
|
57
61
|
Not supported, please use [jquery.turbolinks gem](https://github.com/kossnocorp/jquery.turbolinks).
|
@@ -1,8 +1,7 @@
|
|
1
1
|
$cookies-bar-position: bottom !default; // or top
|
2
2
|
$cookies-bar-background-color: #f2f2f2 !default;
|
3
|
-
$cookies-bar-
|
4
|
-
$cookies-bar-
|
5
|
-
$cookies-bar-btn-
|
6
|
-
$cookies-bar-btn-
|
7
|
-
|
3
|
+
$cookies-bar-text-color: #333333 !default;
|
4
|
+
$cookies-bar-link-color: $cookies-bar-text-color !default;
|
5
|
+
$cookies-bar-btn-color: #777777 !default;
|
6
|
+
$cookies-bar-btn-text-color: #ffffff !default;
|
8
7
|
$cookies-bar-line-height: 40px !default;
|
@@ -4,34 +4,39 @@
|
|
4
4
|
position: fixed;
|
5
5
|
left: 0;
|
6
6
|
#{$cookies-bar-position}: 0;
|
7
|
+
color: $cookies-bar-text-color;
|
7
8
|
line-height: $cookies-bar-line-height;
|
8
9
|
background: $cookies-bar-background-color;
|
9
|
-
border-top: 1px solid $cookies-bar-
|
10
|
+
border-top: 1px solid darken($cookies-bar-background-color, 10%);
|
11
|
+
border-bottom: 1px solid darken($cookies-bar-background-color, 10%);
|
10
12
|
width: 100%;
|
11
13
|
z-index: 999;
|
12
14
|
text-align: center;
|
13
15
|
|
14
16
|
.eu-cookies-content-holder {
|
15
17
|
display: inline-block;
|
16
|
-
padding: 0
|
18
|
+
padding: 0 10px;
|
17
19
|
line-height: 26px;
|
20
|
+
|
21
|
+
.eu-cookies-link {
|
22
|
+
color: $cookies-bar-link-color;
|
23
|
+
}
|
18
24
|
}
|
25
|
+
|
19
26
|
.eu-cookies-button-holder {
|
20
27
|
display: inline-block;
|
21
28
|
padding-right: 20px;
|
22
29
|
|
23
30
|
.eu-cookies-ok {
|
24
31
|
background-color: $cookies-bar-btn-color;
|
25
|
-
|
26
|
-
border: 1px solid $cookies-bar-btn-border-color;
|
32
|
+
border: 1px solid $cookies-bar-btn-color;
|
27
33
|
border-radius: 2px;
|
28
|
-
color:
|
29
|
-
cursor: default;
|
34
|
+
color: $cookies-bar-btn-text-color;
|
30
35
|
display: inline-block;
|
31
36
|
font-size: 11px;
|
32
37
|
font-weight: bold;
|
33
38
|
height: 24px;
|
34
|
-
line-height:
|
39
|
+
line-height: 21px;
|
35
40
|
margin-right: 0px;
|
36
41
|
min-width: 26px;
|
37
42
|
outline: 0;
|
@@ -20,6 +20,10 @@ module EuCookiesHelper
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def cookies_policy_link
|
23
|
-
EuCookies.display_policy == true
|
23
|
+
if EuCookies.display_policy == true
|
24
|
+
main_app.cookies_policy_path
|
25
|
+
else
|
26
|
+
EuCookies.display_policy
|
27
|
+
end
|
24
28
|
end
|
25
29
|
end
|
@@ -1,13 +1,16 @@
|
|
1
1
|
<%= content_tag :div, class: "eu-cookies", data: cookies_bar_data do %>
|
2
2
|
<span class="eu-cookies-content-holder">
|
3
3
|
<%= t('eu_cookies.short_html') %>
|
4
|
+
|
5
|
+
<% if display_cookies_policy? %>
|
6
|
+
<%= link_to t('eu_cookies.learn_more'), cookies_policy_link,
|
7
|
+
class: 'eu-cookies-link', target: "_blank" %>
|
8
|
+
<% end %>
|
4
9
|
</span>
|
10
|
+
|
5
11
|
<span class="eu-cookies-button-holder">
|
6
|
-
<
|
12
|
+
<a class="eu-cookies-ok" href="#">
|
7
13
|
<%= t('eu_cookies.ok') %>
|
8
|
-
</
|
9
|
-
|
10
|
-
<%= link_to t('eu_cookies.learn_more'), cookies_policy_link,
|
11
|
-
class: 'eu-cookies-link', target: "_blank" if display_cookies_policy? %>
|
14
|
+
</a>
|
12
15
|
</span>
|
13
16
|
<% end %>
|
data/lib/eu_cookies/version.rb
CHANGED
@@ -2,11 +2,10 @@
|
|
2
2
|
|
3
3
|
// $cookies-bar-position: bottom; // or top
|
4
4
|
// $cookies-bar-background-color: #f2f2f2;
|
5
|
-
// $cookies-bar-
|
6
|
-
// $cookies-bar-
|
7
|
-
// $cookies-bar-btn-
|
8
|
-
// $cookies-bar-btn-
|
9
|
-
|
5
|
+
// $cookies-bar-text-color: #333333;
|
6
|
+
// $cookies-bar-link-color: $cookies-bar-text-color;
|
7
|
+
// $cookies-bar-btn-color: #777777;
|
8
|
+
// $cookies-bar-btn-text-color: #ffffff;
|
10
9
|
// $cookies-bar-line-height: 40px;
|
11
10
|
|
12
11
|
// keep this on the last line
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eu_cookies
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alessandro Lepore
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-08-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|