Allow accept essential cookies from consent banner
Set cookie duration to 365 days based on the AEPD's cookie usage guidelines. Note from the document: "Cookies with a duration of up to 24 months are considered acceptable as long as they are periodically updated." Reference: https://www.aepd.es/guias/guia-cookies.pdf
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<div id="cookies_consent_banner" class="cookies-consent-banner">
|
||||
<h2><%= t("cookies_consent.title") %></h2>
|
||||
<p><%= t("cookies_consent.message") %></p>
|
||||
<button type="button" class="accept-essential-cookies"><%= t("cookies_consent.accept_essential_cookies") %></button>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
class Layout::CookiesConsent::BannerComponent < ApplicationComponent
|
||||
delegate :cookies, to: :helpers
|
||||
|
||||
def render?
|
||||
feature?(:cookies_consent)
|
||||
feature?(:cookies_consent) && cookies_consent_unset?
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def cookies_consent_unset?
|
||||
cookies["cookies_consent"].blank?
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user