-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* implemented cookies banner * change cookies-banner-modal class * change cookies-banner-modal class * edit step_definitions/event_steps.rb * edit step_definitions/event_steps.rb * edit cookie-banner width * edit cookie-banner width * edit cookie-banner width * edit cookie-banner width * change target(click) back to.click * x button to hide consent banner if user chooses neither cookie option * activate google analytics only when user accepts cookies * activate google analytics only when user accepts cookies * activate google analytics only when user accepts cookies * x button to hide consent banner if user chooses neither cookie option * x button to hide consent banner if user chooses neither cookie option * x button to hide consent banner if user chooses neither cookie option * x button to hide consent banner if user chooses neither cookie option --------- Co-authored-by: mac <[email protected]> Co-authored-by: Matt Lindsey <[email protected]>
- Loading branch information
1 parent
4a75a6e
commit d4bc410
Showing
17 changed files
with
80 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ | |
# Ignore bundler config. | ||
/.bundle | ||
|
||
/vendor/bundle | ||
|
||
# Ignore coverage results | ||
|
||
/coverage | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
if (sessionStorage.getItem('banner') === 'hide') { | ||
document.querySelector('.cookies-banner-modal').style.display = 'none'; | ||
} else { | ||
document.querySelector('.close').addEventListener('click', () => { | ||
sessionStorage.setItem('banner', 'hide') | ||
document.querySelector('.cookies-banner-modal').style.display = 'none'; | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# frozen_string_literal: true | ||
|
||
class CookiesController < ApplicationController | ||
def index | ||
session[:cookies_accepted] = params[:cookies] if params[:cookies] | ||
redirect_back_or_to '/' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
module CookiesHelper | ||
end |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<% if session[:cookies_accepted].nil? && !(request.cookies['_ga'].present? || request.cookies['_gid'].present? || request.cookies['_gat'].present?)# don't re-render if a true/false selected %> | ||
<section class="cookies-banner-modal"> | ||
<a class="close">X</a> | ||
<h4>We respect your privacy. Cookies are used to analyze traffic.</h4> | ||
<%= link_to "Accept cookies", cookies_path(cookies: true), method: :post, class: 'btn btn-success' %> | ||
<%= link_to "Reject cookies", cookies_path(cookies: false), method: :post, class: 'btn btn-default' %> | ||
<%= link_to 'Privacy statement', '/privacy' %> | ||
</section> | ||
<% end %> | ||
<%= javascript_include_tag 'cookies_banner' %> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters