eu_cookies 1.0.3 → 1.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cca09d0afc0c3cd1576476fadba579ed735f0e45
4
- data.tar.gz: f45f86a490319eaa012752c85650b69e7984e858
3
+ metadata.gz: 3fa48eb9dac60abf79394dc56ecc86f61c431c3f
4
+ data.tar.gz: f85fb2bca6de16291aaa8c4d36a22dadcdf14d09
5
5
  SHA512:
6
- metadata.gz: 9831d7c7252b272b84280a861981d31cacb402a13fc318f9882dd6939390f0d7b288361feb98ff6259afbc8b1cd056abce57d434c27615c4d6c8ca7f88c84291
7
- data.tar.gz: 12288284d95a073bc4167cb65ef5ba402db71e006a16092dd27d9738068c98ebc99799cd5c907191b047cc4886d00e62063f07bfd8a6df8635265f836f236cf5
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 `/cookies-policy` page with the
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
- EuCookies.use_scroll = false # true to treat page scroll as acceptance
41
- EuCookies.display_policy = true # false to remove link, a string to link an external policy
42
- EuCookies.enabled = true # false to disable all the features
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 short cookies bar message is available in English, Croatian, Dutch, Estonian,
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-border-color: #e4e4e4 !default;
4
- $cookies-bar-btn-color: #4d90fe !default;
5
- $cookies-bar-btn-color2: #4787ed !default;
6
- $cookies-bar-btn-border-color: #3079ed !default;
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-border-color;
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 20px;
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
- background-image: -webkit-linear-gradient(top, $cookies-bar-btn-color, $cookies-bar-btn-color2);
26
- border: 1px solid $cookies-bar-btn-border-color;
32
+ border: 1px solid $cookies-bar-btn-color;
27
33
  border-radius: 2px;
28
- color: #fff;
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: 20px;
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 ? cookies_policy_path : EuCookies.display_policy
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
- <button class="eu-cookies-ok">
12
+ <a class="eu-cookies-ok" href="#">
7
13
  <%= t('eu_cookies.ok') %>
8
- </button>
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 %>
@@ -1,3 +1,3 @@
1
1
  module EuCookies
2
- VERSION = "1.0.3"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -2,11 +2,10 @@
2
2
 
3
3
  // $cookies-bar-position: bottom; // or top
4
4
  // $cookies-bar-background-color: #f2f2f2;
5
- // $cookies-bar-border-color: #e4e4e4;
6
- // $cookies-bar-btn-color: #4d90fe;
7
- // $cookies-bar-btn-color2: #4787ed;
8
- // $cookies-bar-btn-border-color: #3079ed;
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.3
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-07-27 00:00:00.000000000 Z
12
+ date: 2015-08-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties