mirror of
https://github.com/infinum/cookies_eu
synced 2023-03-27 23:21:16 -04:00
Compare commits
106 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3a0ad36b51 | ||
![]() |
82167b3e3d | ||
![]() |
3f91806082 | ||
![]() |
e00e4d39fa | ||
![]() |
cf95a398b7 | ||
![]() |
1827842c03 | ||
![]() |
9e27ef7295 | ||
![]() |
bae2eee30c | ||
![]() |
dc0cc6a0c3 | ||
![]() |
adb8404543 | ||
![]() |
b9b2d20d1b | ||
![]() |
315680a5c7 | ||
![]() |
f46c4ab522 | ||
![]() |
89da8f2c00 | ||
![]() |
644044a8dd | ||
![]() |
c3cec6f75a | ||
![]() |
c26aa6b42d | ||
![]() |
0ab13f6288 | ||
![]() |
70c94cd900 | ||
![]() |
d84fcd4d33 | ||
![]() |
e20a447932 | ||
![]() |
2662ccbc11 | ||
![]() |
a12a7ad110 | ||
![]() |
d6431c065d | ||
![]() |
96bd3d0ab6 | ||
![]() |
3df0f54624 | ||
![]() |
6466d3461d | ||
![]() |
c69c670a6d | ||
![]() |
8bda73317a | ||
![]() |
4832fc7115 | ||
![]() |
4f2e722c28 | ||
![]() |
4004f81eca | ||
![]() |
8b2030d6a1 | ||
![]() |
ffc02ac595 | ||
![]() |
232c92faab | ||
![]() |
cf8bae9590 | ||
![]() |
f1fa7215b8 | ||
![]() |
a2d74d3378 | ||
![]() |
46ad3ea706 | ||
![]() |
af2a6e10b1 | ||
![]() |
ca6a415961 | ||
![]() |
4d8e3a91f0 | ||
![]() |
f497dd7485 | ||
![]() |
26df12c868 | ||
![]() |
52712703ad | ||
![]() |
4487296612 | ||
![]() |
fb773d5448 | ||
![]() |
5e0df30d25 | ||
![]() |
8e18bcefcc | ||
![]() |
a9252f16f3 | ||
![]() |
49a657ec68 | ||
![]() |
020fe1c764 | ||
![]() |
ff649e1b89 | ||
![]() |
0107c1ff62 | ||
![]() |
e3772bb6e3 | ||
![]() |
9f87d4decf | ||
![]() |
21eb363e4a | ||
![]() |
9d9a76d049 | ||
![]() |
cc328cf70c | ||
![]() |
045b39eceb | ||
![]() |
5c7ccc411b | ||
![]() |
4fc6da7f50 | ||
![]() |
3558c6dd94 | ||
![]() |
aaaa32409d | ||
![]() |
d0a1d5653d | ||
![]() |
33cea74dbc | ||
![]() |
6e8079089f | ||
![]() |
c459efaa25 | ||
![]() |
2957a2e1f0 | ||
![]() |
af93ce62ca | ||
![]() |
e0f4309b36 | ||
![]() |
7520dde55d | ||
![]() |
d84d63663f | ||
![]() |
9cb8aa7a6b | ||
![]() |
f0cb75f1af | ||
![]() |
eefe8405c5 | ||
![]() |
9efb24a02f | ||
![]() |
ced1817a28 | ||
![]() |
263a9ee211 | ||
![]() |
a3bf83a8b2 | ||
![]() |
f3bc531403 | ||
![]() |
a037b41fd7 | ||
![]() |
92e922eb85 | ||
![]() |
ddacb78ddd | ||
![]() |
e8ee4ddb8a | ||
![]() |
f99a0010c1 | ||
![]() |
52da532b4b | ||
![]() |
d4177097ad | ||
![]() |
ded657d1d3 | ||
![]() |
43afcccee6 | ||
![]() |
2b7b386e20 | ||
![]() |
41f750121e | ||
![]() |
6da96b62bf | ||
![]() |
164f2a7fc7 | ||
![]() |
8815498e1e | ||
![]() |
40c5bccf67 | ||
![]() |
8499dd4c2e | ||
![]() |
0e72ddc21d | ||
![]() |
277664a41f | ||
![]() |
cb2cff3cbc | ||
![]() |
443dc0b83f | ||
![]() |
7a72aabdad | ||
![]() |
b26d00fb3f | ||
![]() |
ac03b60cc6 | ||
![]() |
796786f41d | ||
![]() |
30d75a5f9c |
25 changed files with 632 additions and 70 deletions
354
.scss-lint.yml
Normal file
354
.scss-lint.yml
Normal file
|
@ -0,0 +1,354 @@
|
|||
# Default application configuration that all configurations inherit from.
|
||||
|
||||
linters:
|
||||
BangFormat:
|
||||
enabled: true
|
||||
space_before_bang: true
|
||||
space_after_bang: false
|
||||
|
||||
BorderZero:
|
||||
enabled: true
|
||||
|
||||
ColorKeyword:
|
||||
enabled: true
|
||||
|
||||
ColorVariable:
|
||||
enabled: true
|
||||
|
||||
Comment:
|
||||
enabled: true
|
||||
|
||||
DebugStatement:
|
||||
enabled: true
|
||||
|
||||
DeclarationOrder:
|
||||
enabled: true
|
||||
|
||||
DuplicateProperty:
|
||||
enabled: true
|
||||
|
||||
ElsePlacement:
|
||||
enabled: true
|
||||
style: same_line # or 'new_line'
|
||||
|
||||
EmptyLineBetweenBlocks:
|
||||
enabled: true
|
||||
ignore_single_line_blocks: true
|
||||
|
||||
EmptyRule:
|
||||
enabled: true
|
||||
|
||||
FinalNewline:
|
||||
enabled: true
|
||||
present: true
|
||||
|
||||
HexLength:
|
||||
enabled: true
|
||||
style: long # 'short' or 'long'
|
||||
|
||||
HexNotation:
|
||||
enabled: true
|
||||
style: uppercase # 'lowercase' or 'uppercase'
|
||||
|
||||
HexValidation:
|
||||
enabled: true
|
||||
|
||||
IdSelector:
|
||||
enabled: true
|
||||
|
||||
ImportantRule:
|
||||
enabled: true
|
||||
|
||||
ImportPath:
|
||||
enabled: true
|
||||
leading_underscore: false
|
||||
filename_extension: false
|
||||
|
||||
Indentation:
|
||||
enabled: true
|
||||
character: space # or 'tab'
|
||||
width: 2
|
||||
|
||||
LeadingZero:
|
||||
enabled: true
|
||||
style: include_zero # exclude_zero or 'include_zero'
|
||||
|
||||
MergeableSelector:
|
||||
enabled: true
|
||||
force_nesting: true
|
||||
|
||||
# NameFormat:
|
||||
# enabled: false
|
||||
# convention: BEM # hyphenated_lowercase or 'BEM', or a regex pattern
|
||||
|
||||
NestingDepth:
|
||||
enabled: true
|
||||
max_depth: 4
|
||||
|
||||
PlaceholderInExtend:
|
||||
enabled: true
|
||||
|
||||
PropertySortOrder:
|
||||
enabled: true
|
||||
order:
|
||||
- font
|
||||
- font-family
|
||||
- font-size
|
||||
- font-weight
|
||||
- font-style
|
||||
- font-variant
|
||||
- font-size-adjust
|
||||
- font-stretch
|
||||
- font-effect
|
||||
- font-emphasize
|
||||
- font-emphasize-position
|
||||
- font-emphasize-style
|
||||
- font-smooth
|
||||
- line-height
|
||||
- # This empty element signals a visual separation
|
||||
- position
|
||||
- z-index
|
||||
- top
|
||||
- right
|
||||
- bottom
|
||||
- left
|
||||
-
|
||||
- display
|
||||
- visibility
|
||||
- float
|
||||
- clear
|
||||
- overflow
|
||||
- overflow-x
|
||||
- overflow-y
|
||||
- clip
|
||||
- zoom
|
||||
- flex-direction
|
||||
- flex-order
|
||||
- flex-pack
|
||||
- flex-align
|
||||
-
|
||||
- box-sizing
|
||||
- width
|
||||
- min-width
|
||||
- max-width
|
||||
- height
|
||||
- min-height
|
||||
- max-height
|
||||
- margin
|
||||
- margin-top
|
||||
- margin-right
|
||||
- margin-bottom
|
||||
- margin-left
|
||||
- padding
|
||||
- padding-top
|
||||
- padding-right
|
||||
- padding-bottom
|
||||
- padding-left
|
||||
-
|
||||
- table-layout
|
||||
- empty-cells
|
||||
- caption-side
|
||||
- border-spacing
|
||||
- border-collapse
|
||||
- list-style
|
||||
- list-style-position
|
||||
- list-style-type
|
||||
- list-style-image
|
||||
-
|
||||
- content
|
||||
- quotes
|
||||
- counter-reset
|
||||
- counter-increment
|
||||
- resize
|
||||
- cursor
|
||||
- user-select
|
||||
- nav-index
|
||||
- nav-up
|
||||
- nav-right
|
||||
- nav-down
|
||||
- nav-left
|
||||
- transition
|
||||
- transition-delay
|
||||
- transition-timing-function
|
||||
- transition-duration
|
||||
- transition-property
|
||||
- transform
|
||||
- transform-origin
|
||||
- animation
|
||||
- animation-name
|
||||
- animation-duration
|
||||
- animation-play-state
|
||||
- animation-timing-function
|
||||
- animation-delay
|
||||
- animation-iteration-count
|
||||
- animation-direction
|
||||
- text-align
|
||||
- text-align-last
|
||||
- vertical-align
|
||||
- white-space
|
||||
- text-decoration
|
||||
- text-emphasis
|
||||
- text-emphasis-color
|
||||
- text-emphasis-style
|
||||
- text-emphasis-position
|
||||
- text-indent
|
||||
- text-justify
|
||||
- letter-spacing
|
||||
- word-spacing
|
||||
- text-outline
|
||||
- text-transform
|
||||
- text-wrap
|
||||
- text-overflow
|
||||
- text-overflow-ellipsis
|
||||
- text-overflow-mode
|
||||
- word-wrap
|
||||
- word-break
|
||||
- tab-size
|
||||
- hyphens
|
||||
- pointer-events
|
||||
-
|
||||
- opacity
|
||||
- filter
|
||||
- color
|
||||
- border
|
||||
- border-width
|
||||
- border-style
|
||||
- border-color
|
||||
- border-top
|
||||
- border-top-width
|
||||
- border-top-style
|
||||
- border-top-color
|
||||
- border-right
|
||||
- border-right-width
|
||||
- border-right-style
|
||||
- border-right-color
|
||||
- border-bottom
|
||||
- border-bottom-width
|
||||
- border-bottom-style
|
||||
- border-bottom-color
|
||||
- border-left
|
||||
- border-left-width
|
||||
- border-left-style
|
||||
- border-left-color
|
||||
- border-radius
|
||||
- border-top-left-radius
|
||||
- border-top-right-radius
|
||||
- border-bottom-right-radius
|
||||
- border-bottom-left-radius
|
||||
- border-image
|
||||
- border-image-source
|
||||
- border-image-slice
|
||||
- border-image-width
|
||||
- border-image-outset
|
||||
- border-image-repeat
|
||||
- outline
|
||||
- outline-width
|
||||
- outline-style
|
||||
- outline-color
|
||||
- outline-offset
|
||||
- background
|
||||
- background-color
|
||||
- background-image
|
||||
- background-repeat
|
||||
- background-attachment
|
||||
- background-position
|
||||
- background-position-x
|
||||
- background-position-y
|
||||
- background-clip
|
||||
- background-origin
|
||||
- background-size
|
||||
- box-decoration-break
|
||||
- box-shadow
|
||||
- text-shadow
|
||||
separate_groups: true
|
||||
|
||||
PropertySpelling:
|
||||
enabled: true
|
||||
extra_properties: []
|
||||
|
||||
QualifyingElement:
|
||||
enabled: true
|
||||
allow_element_with_attribute: true
|
||||
allow_element_with_class: false
|
||||
allow_element_with_id: false
|
||||
|
||||
SelectorDepth:
|
||||
enabled: true
|
||||
max_depth: 3
|
||||
|
||||
SelectorFormat:
|
||||
enabled: true
|
||||
convention: ^([\.\%]?[a-z]*[-]?[a-z0-9\-]*)(\.[a-z0-9\-]*)?(__[a-z0-9]*[-]?[a-z0-9\-]*)?(_[a-z0-9]*[-]?[a-z0-9\-]*)?(\:[a-z]*)*$ # or 'hyphenated_lowercase', or 'snake_case', or 'camel_case', or a regex pattern
|
||||
|
||||
Shorthand:
|
||||
enabled: true
|
||||
allowed_shorthands: [1, 2]
|
||||
|
||||
SingleLinePerProperty:
|
||||
enabled: true
|
||||
allow_single_line_rule_sets: true
|
||||
|
||||
SingleLinePerSelector:
|
||||
enabled: true
|
||||
|
||||
SpaceAfterComma:
|
||||
enabled: true
|
||||
|
||||
SpaceAfterPropertyColon:
|
||||
enabled: true
|
||||
style: one_space # or 'no_space', or 'at_least_one_space', or 'aligned'
|
||||
|
||||
SpaceAfterPropertyName:
|
||||
enabled: true
|
||||
|
||||
SpaceAfterVariableName:
|
||||
enabled: true
|
||||
|
||||
SpaceAroundOperator:
|
||||
enabled: true
|
||||
|
||||
SpaceBeforeBrace:
|
||||
enabled: true
|
||||
allow_single_line_padding: false
|
||||
|
||||
SpaceBetweenParens:
|
||||
enabled: true
|
||||
spaces: 0
|
||||
|
||||
StringQuotes:
|
||||
enabled: true
|
||||
style: single_quotes # or double_quotes
|
||||
|
||||
TrailingSemicolon:
|
||||
enabled: true
|
||||
|
||||
TrailingZero:
|
||||
enabled: true
|
||||
|
||||
TransitionAll:
|
||||
enabled: true
|
||||
|
||||
UnnecessaryMantissa:
|
||||
enabled: true
|
||||
|
||||
UnnecessaryParentReference:
|
||||
enabled: true
|
||||
|
||||
UrlFormat:
|
||||
enabled: true
|
||||
|
||||
UrlQuotes:
|
||||
enabled: true
|
||||
|
||||
VariableForProperty:
|
||||
enabled: true
|
||||
properties: [color, font, background-color]
|
||||
|
||||
VendorPrefix:
|
||||
enabled: true
|
||||
|
||||
ZeroUnit:
|
||||
enabled: true
|
||||
|
||||
Compass::*:
|
||||
enabled: false
|
78
README.md
78
README.md
|
@ -1,26 +1,43 @@
|
|||
[](https://badge.fury.io/rb/cookies_eu)
|
||||
|
||||
# CookiesEu
|
||||
|
||||
Gem to add cookie consent to rails application
|
||||
|
||||
## Supported languages
|
||||
|
||||
* Albanian
|
||||
* Basque
|
||||
* Bulgarian
|
||||
* Catalan
|
||||
* Croatian
|
||||
* Czech
|
||||
* Danish
|
||||
* Dutch
|
||||
* English
|
||||
* Estonian
|
||||
* Finnish
|
||||
* French
|
||||
* German
|
||||
* Greek
|
||||
* Hebrew
|
||||
* Hungarian
|
||||
* Italian
|
||||
* Lithuanian
|
||||
* Norwegian
|
||||
* Polish
|
||||
* Portuguese
|
||||
* Romanian
|
||||
* Russian
|
||||
* Slovenian
|
||||
* Spanish
|
||||
* Swedish
|
||||
* Turkish
|
||||
* Ukrainian
|
||||
|
||||
## Prerequisites
|
||||
## Screenshot
|
||||
|
||||
jquery needs to be present in your application.js
|
||||

|
||||
|
||||
## Installation
|
||||
|
||||
|
@ -46,6 +63,12 @@ And in application.css:
|
|||
|
||||
*= require cookies_eu
|
||||
|
||||
Or, if you have application.scss:
|
||||
|
||||
@import "cookies_eu";
|
||||
|
||||
Remember to restart your server!
|
||||
|
||||
## Usage
|
||||
|
||||
In your view add
|
||||
|
@ -60,18 +83,44 @@ You can add a link parameter to link to your cookies explanation page (you have
|
|||
= render 'cookies_eu/consent_banner', link: '/cookies'
|
||||
```
|
||||
|
||||
You can add a target parameter to the link to open in a new tab
|
||||
|
||||
If you whish to customize the style of the div the classes are:
|
||||
|
||||
```javascript
|
||||
.cookies_eu // main div
|
||||
.cookies_eu_ok // button
|
||||
.cookies_eu_link // link
|
||||
```ruby
|
||||
= render 'cookies_eu/consent_banner', link: '/cookies', target: '_blank'
|
||||
```
|
||||
|
||||
## Turbolinks NOT supported
|
||||
If you wish to customize the style of the div the classes are:
|
||||
|
||||
Please use [jquery.turbolinks gem](https://github.com/kossnocorp/jquery.turbolinks)
|
||||
```css
|
||||
.cookies-eu /* main div */
|
||||
.cookies-eu-content-holder /* content holder */
|
||||
.cookies-eu-button-holder /* button holder */
|
||||
.cookies-eu-ok /* button */
|
||||
.cookies-eu-link /* link */
|
||||
```
|
||||
|
||||
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)
|
||||
|
||||
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.
|
||||
|
||||
```javascript
|
||||
document.addEventListener('cookies-eu-acknowledged', function() {
|
||||
// The user has acknowledged cookies! If they're logged in, make an api call
|
||||
// so we remember their preference.
|
||||
fetch('...');
|
||||
});
|
||||
```
|
||||
|
||||
## Cookies used
|
||||
|
||||
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.
|
||||
|
||||
## Turbolinks 5+
|
||||
|
||||
Is supported out of the box, just require it before cookies_eu
|
||||
|
||||
//= require turbolinks
|
||||
//= require cookies_eu
|
||||
|
||||
## Sample of cookie info (in [haml form](/app/views/cookies_eu/cookies_info.html.haml))
|
||||
|
||||
|
@ -123,7 +172,7 @@ To enable cookies on our website, follow the steps below.
|
|||
|
||||
1. Click "Tools" at the top of your browser and select "Settings".
|
||||
2. Click "Show advanced settings", scroll down to the section "Privacy" and click "Content Settings."
|
||||
3. Select "Allow local data to be set". To only acept first-party cookies, check the box next to "Block all third-party cookies without exception"
|
||||
3. Select "Allow local data to be set". To only accept first-party cookies, check the box next to "Block all third-party cookies without exception"
|
||||
|
||||
##### Microsoft Internet Explorer 6.0, 7.0, 8.0, 9.0
|
||||
|
||||
|
@ -178,3 +227,10 @@ To enable cookies on our website, follow the steps below.
|
|||
3. Commit your changes (`git commit -am 'Add some feature'`)
|
||||
4. Push to the branch (`git push origin my-new-feature`)
|
||||
5. Create new Pull Request
|
||||
|
||||
## Credits
|
||||
|
||||
Maintained and sponsored by
|
||||
[Infinum](http://www.infinum.co).
|
||||
|
||||
<img src="https://infinum.co/infinum.png" width="264">
|
||||
|
|
|
@ -1,9 +1,65 @@
|
|||
//= require jquery.cookie
|
||||
//= require js.cookie
|
||||
'use strict';
|
||||
|
||||
$(document).ready( function(){
|
||||
$('.cookies-eu-ok').click(function(e){
|
||||
e.preventDefault();
|
||||
$.cookie('cookie_eu_consented', 'true', { path: '/', expires: 365 });
|
||||
$('.cookies-eu').remove();
|
||||
});
|
||||
});
|
||||
var windowIsTurbolinked = 'Turbolinks' in window;
|
||||
|
||||
var cookiesEu = {
|
||||
init: function() {
|
||||
var cookiesEuOKButton = document.querySelector('.js-cookies-eu-ok');
|
||||
|
||||
if (cookiesEuOKButton) {
|
||||
this.addListener(cookiesEuOKButton);
|
||||
// clear turbolinks cache so cookie banner does not reappear
|
||||
windowIsTurbolinked && window.Turbolinks.clearCache();
|
||||
}
|
||||
},
|
||||
|
||||
addListener: function(target) {
|
||||
// Support for IE < 9
|
||||
if (target.attachEvent) {
|
||||
target.attachEvent('onclick', this.setCookie);
|
||||
} else {
|
||||
target.addEventListener('click', this.setCookie, false);
|
||||
}
|
||||
},
|
||||
|
||||
setCookie: function() {
|
||||
var isSecure = location.protocol === 'https:';
|
||||
Cookies.set('cookie_eu_consented', true, { path: '/', expires: 365, secure: isSecure });
|
||||
|
||||
var container = document.querySelector('.js-cookies-eu');
|
||||
container.parentNode.removeChild(container);
|
||||
|
||||
document.dispatchEvent(new CustomEvent('cookies-eu-acknowledged'));
|
||||
}
|
||||
};
|
||||
|
||||
(function() {
|
||||
function eventName(fallback) {
|
||||
return windowIsTurbolinked ? 'turbolinks:load' : fallback
|
||||
}
|
||||
|
||||
var isCalled = false;
|
||||
|
||||
function isReady() {
|
||||
// return early when cookiesEu.init has been called AND Turbolinks is NOT included
|
||||
// when Turbolinks is included cookiesEu.init has to be called on every page load
|
||||
if (isCalled && !windowIsTurbolinked) {
|
||||
return
|
||||
}
|
||||
isCalled = true;
|
||||
|
||||
cookiesEu.init();
|
||||
}
|
||||
|
||||
if (document.addEventListener) {
|
||||
return document.addEventListener(eventName('DOMContentLoaded'), isReady, false);
|
||||
}
|
||||
|
||||
// Old browsers IE < 9
|
||||
if (window.addEventListener) {
|
||||
window.addEventListener(eventName('load'), isReady, false);
|
||||
} else if (window.attachEvent) {
|
||||
window.attachEvent(eventName('onload'), isReady);
|
||||
}
|
||||
})();
|
||||
|
|
|
@ -1,57 +1,59 @@
|
|||
$cookies-eu-background-color: #F2F2F2;
|
||||
$cookies-eu-border-color: #E4E4E4;
|
||||
$cookies-eu-button-background-color: #4D90FE;
|
||||
$cookies-eu-button-color: #FFFFFF;
|
||||
$cookies-eu-mobile: 'max-width: 767px';
|
||||
|
||||
.cookies-eu {
|
||||
line-height: 40px;
|
||||
|
||||
position: fixed;
|
||||
z-index: 999;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
line-height: 40px;
|
||||
background: #f2f2f2;
|
||||
border-top: 1px solid #e4e4e4;
|
||||
width: 100%;
|
||||
z-index: 999;
|
||||
|
||||
padding: 0 20px;
|
||||
|
||||
text-align: center;
|
||||
|
||||
border-top: 1px solid $cookies-eu-border-color;
|
||||
background: $cookies-eu-background-color;
|
||||
|
||||
@media ($cookies-eu-mobile) {
|
||||
font-size: 12px;
|
||||
line-height: 30px;
|
||||
|
||||
position: initial;
|
||||
}
|
||||
|
||||
.cookies-eu-content-holder {
|
||||
display: inline-block;
|
||||
|
||||
padding: 0 20px;
|
||||
line-height: 26px;
|
||||
}
|
||||
|
||||
.cookies-eu-button-holder {
|
||||
display: inline-block;
|
||||
padding-right: 20px;
|
||||
|
||||
.cookies-eu-ok {
|
||||
background-color: #4d90fe;
|
||||
background-image: -webkit-linear-gradient(top,#4d90fe,#4787ed);
|
||||
border: 1px solid #3079ed;
|
||||
border-radius: 2px;
|
||||
color: #fff;
|
||||
cursor: default;
|
||||
display: inline-block;
|
||||
font-size: 11px;
|
||||
font-weight: bold;
|
||||
height: 24px;
|
||||
|
||||
line-height: 20px;
|
||||
margin-right: 0px;
|
||||
|
||||
min-width: 26px;
|
||||
outline: 0;
|
||||
padding: 0 11px;
|
||||
margin-right: 5px;
|
||||
padding: 2px 11px;
|
||||
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
margin: 0 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767px){
|
||||
.cookies-eu{
|
||||
position: static;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
.cookies-eu-content-holder{
|
||||
line-height: 16px;
|
||||
padding: 5px 20px;
|
||||
}
|
||||
.cookies-eu-button-holder{
|
||||
padding-bottom: 5px;
|
||||
color: $cookies-eu-button-color;
|
||||
border: 0;
|
||||
outline: none;
|
||||
background-color: $cookies-eu-button-background-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
<% if cookies['cookie_eu_consented'] != 'true' %>
|
||||
<div class="cookies-eu">
|
||||
<span class="cookies-eu-content-holder"><%= t('cookies_eu.cookies_text') %></span>
|
||||
<span class="cookies-eu-button-holder">
|
||||
<button class="cookies-eu-ok"> <%= t('cookies_eu.ok') %> </button>
|
||||
<% if defined?(link).present? %>
|
||||
<a href="<%= link %>" class="cookies-eu-link"> <%= t('cookies_eu.learn_more') %> </a>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<% if cookies.kind_of? ActionDispatch::Cookies::CookieJar %>
|
||||
<% if cookies && cookies['cookie_eu_consented'] != 'true' %>
|
||||
<div class="cookies-eu js-cookies-eu" <%= "dir=rtl" if I18n.exists?('cookies_eu.direction', I18n.locale) && I18n.t("cookies_eu.direction") == "rtl" %>>
|
||||
<span class="cookies-eu-content-holder"><%= t('cookies_eu.cookies_text') %></span>
|
||||
<span class="cookies-eu-button-holder">
|
||||
<button class="cookies-eu-ok js-cookies-eu-ok"> <%= t('cookies_eu.ok') %> </button>
|
||||
<% if defined?(link).present? %>
|
||||
<a href="<%= link %>" class="cookies-eu-link" target="<%= defined?(target).present? ? target : '' %>"> <%= t('cookies_eu.learn_more') %> </a>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% raise Exception.new "'cookies' is a reserved Rails class, please rename your method" %>
|
||||
<% end %>
|
||||
|
|
5
config/locales/bg.yml
Normal file
5
config/locales/bg.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
bg:
|
||||
cookies_eu:
|
||||
cookies_text: "Курабийките ни помагат да доставяме услугите си. Използвайки нашите услуги, вие се съгласявате с нашето използване на курабийки."
|
||||
learn_more: "Научи повече"
|
||||
ok: "ОК"
|
5
config/locales/ca.yml
Normal file
5
config/locales/ca.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
ca:
|
||||
cookies_eu:
|
||||
cookies_text: "Les cookies ens ajuden a oferir els nostres serveis. En utilitzar els nostres serveis, acceptes l'ús de cookies."
|
||||
learn_more: "Més informació"
|
||||
ok: "OK"
|
5
config/locales/cs.yml
Normal file
5
config/locales/cs.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
cs:
|
||||
cookies_eu:
|
||||
cookies_text: "Cookies nám pomáhají poskytovat Vám naše služby. Využíváním těchto služeb souhlasíte s jejich použitím."
|
||||
learn_more: "Dozvědět se více"
|
||||
ok: "OK"
|
5
config/locales/da.yml
Normal file
5
config/locales/da.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
da:
|
||||
cookies_eu:
|
||||
cookies_text: "Cookies hjælper os til at give dig den bedste oplevelse. Ved at bruge vores ydelse, accepterer du vores cookies."
|
||||
learn_more: "Lær mere"
|
||||
ok: "OK"
|
5
config/locales/el.yml
Normal file
5
config/locales/el.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
el:
|
||||
cookies_eu:
|
||||
cookies_text: "Τα cookies μας βοηθούν να προσφέρουμε τις υπηρεσίες μας. Με την χρήση των υπηρεσιών μας, συμφωνείτε στην χρήση των cookies."
|
||||
learn_more: "Μάθετε περισσότερα"
|
||||
ok: "OK"
|
5
config/locales/eu.yml
Normal file
5
config/locales/eu.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
eu:
|
||||
cookies_eu:
|
||||
cookies_text: "Cookieek gure zerbitzuak eskaintzen laguntzen digute. Gure zerbitzuak erabiltzerakoan, cookie-erabilera onartzen duzu."
|
||||
learn_more: "Informazio gehiago"
|
||||
ok: "OK"
|
5
config/locales/fi.yml
Normal file
5
config/locales/fi.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
fi:
|
||||
cookies_eu:
|
||||
cookies_text: "Evästeet auttavat meitä tarjoamaan palveluitamme. Käyttämällä palveluitamme sitoudut käyttämään evästeitä."
|
||||
learn_more: "Lue lisää"
|
||||
ok: "OK"
|
6
config/locales/he.yml
Normal file
6
config/locales/he.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
he:
|
||||
cookies_eu:
|
||||
cookies_text: "העוגיות עוזרות לנו לספק את שירותינו. על ידי השימוש בשירותים שלנו אתה מסכים לשימוש שלנו בעוגיות."
|
||||
learn_more: "למד/י עוד"
|
||||
ok: "בסדר"
|
||||
direction: "rtl"
|
5
config/locales/hu.yml
Normal file
5
config/locales/hu.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
hu:
|
||||
cookies_eu:
|
||||
cookies_text: "A weboldalon sütiket használunk, hogy kényelmesebb legyen a böngészés."
|
||||
learn_more: "További információ"
|
||||
ok: "OK"
|
5
config/locales/lt.yml
Normal file
5
config/locales/lt.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
lt:
|
||||
cookies_eu:
|
||||
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."
|
||||
learn_more: "Daugiau informacijos"
|
||||
ok: "OK"
|
5
config/locales/pt.yml
Normal file
5
config/locales/pt.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
pt:
|
||||
cookies_eu:
|
||||
cookies_text: "As cookies ajudam-nos a oferecer os nossos serviços. Ao utilizar os nossos serviços, aceita o uso de cookies."
|
||||
learn_more: "Mais informações"
|
||||
ok: "OK"
|
5
config/locales/ro.yml
Normal file
5
config/locales/ro.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
ro:
|
||||
cookies_eu:
|
||||
cookies_text: "Cookies ne ajuta la livrarea serviciului. Folosind serviciul nostru, consemnati la utilizarea cookies-urilor."
|
||||
learn_more: "Mai multe"
|
||||
ok: "OK"
|
5
config/locales/sk.yml
Normal file
5
config/locales/sk.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
sk:
|
||||
cookies_eu:
|
||||
cookies_text: "Cookies nám pomáhajú poskytovať Vám naše služby. Využívaním týchto služieb súhlasíte s ich použitím."
|
||||
learn_more: "Oboznámiť sa podrobnejšie"
|
||||
ok: "OK"
|
5
config/locales/sq.yml
Normal file
5
config/locales/sq.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
sq:
|
||||
cookies_eu:
|
||||
cookies_text: "Cookies na ndihmojnë t'ju sigurojmë shërbimet tona. Duke përdorur shërbimet tona, ju pranoni përdorimin tonë të cookies."
|
||||
learn_more: "Mëso më shumë"
|
||||
ok: "OK"
|
5
config/locales/tr.yml
Normal file
5
config/locales/tr.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
tr:
|
||||
cookies_eu:
|
||||
cookies_text: "Çerezler, hizmetlerimizi sunmamıza yardımcı oluyor. Hizmetlerimizi kullanarak, çerez kullanımımızı kabul etmiş olursunuz. "
|
||||
learn_more: "Detayları Göster"
|
||||
ok: "Tamam"
|
5
config/locales/ua.yml
Normal file
5
config/locales/ua.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
ua:
|
||||
cookies_eu:
|
||||
cookies_text: "Cookies допомагають нам надавати наші послуги. Використовуючи наші послуги, ви погоджуєтеся з використанням наших cookies."
|
||||
learn_more: "Детальніше"
|
||||
ok: "OK"
|
|
@ -6,8 +6,8 @@ require 'cookies_eu/version'
|
|||
Gem::Specification.new do |spec|
|
||||
spec.name = "cookies_eu"
|
||||
spec.version = CookiesEu::VERSION
|
||||
spec.authors = ["Stjepan Hadjic"]
|
||||
spec.email = ["stjepan.hadjic@infinum.hr"]
|
||||
spec.authors = ["Stjepan Hadjic", "Gabrijel Skoro"]
|
||||
spec.email = ["stjepan.hadjic@infinum.hr", "gabrijel.skoro@gmail.com"]
|
||||
spec.description = %q{Displays a cookie consent}
|
||||
spec.summary = %q{Displays a cookie consent. If you dont disable cokkies in settings, we assume you are ok with us using cookies}
|
||||
spec.homepage = "https://github.com/infinum/cookies_eu"
|
||||
|
@ -18,8 +18,7 @@ Gem::Specification.new do |spec|
|
|||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "jquery-rails"
|
||||
spec.add_dependency "jquery-cookie-rails"
|
||||
spec.add_dependency "js_cookie_rails", "~> 2.2.0"
|
||||
spec.add_development_dependency "bundler", "~> 1.3"
|
||||
spec.add_development_dependency "rake"
|
||||
end
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
require "cookies_eu/version"
|
||||
require "cookies_eu/engine"
|
||||
require 'jquery-rails'
|
||||
require 'jquery-cookie-rails'
|
||||
require "js_cookie_rails"
|
||||
|
||||
module CookiesEu
|
||||
end
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
module CookiesEu
|
||||
VERSION = "1.2.0"
|
||||
VERSION = "1.7.8"
|
||||
end
|
||||
|
|
|
@ -6,7 +6,18 @@ module CookiesEu
|
|||
end
|
||||
|
||||
def add_stylesheets
|
||||
inject_into_file 'app/assets/stylesheets/application.css', "*= require cookies_eu\n", before: /\*\//, verbose: true
|
||||
file = 'app/assets/stylesheets/application'
|
||||
css_file = "#{file}.css"
|
||||
scss_file = "#{file}.scss"
|
||||
css_scss_file = "#{file}.css.scss"
|
||||
|
||||
if File.exists?(css_file)
|
||||
inject_into_file css_file, "*= require cookies_eu\n", before: /\*\//, verbose: true
|
||||
elsif File.exists?(scss_file)
|
||||
append_file scss_file, "@import 'cookies_eu';\n"
|
||||
else
|
||||
append_file css_scss_file, "@import 'cookies_eu';\n"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue