mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-10 23:07:47 +00:00
Extracted cookies footer links from view to footer links helper
This commit is contained in:
11
app/helpers/footer_links_helper.rb
Normal file
11
app/helpers/footer_links_helper.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
require 'web/cookies_consent'
|
||||
|
||||
module FooterLinksHelper
|
||||
def cookies_policy_link
|
||||
link_to( t( '.footer_data_cookies_policy' ), '', 'cookies-policy-modal' => true, 'cookies-banner' => !Web::CookiesConsent.new(cookies, request.host).exists? && Spree::Config.cookies_consent_banner_toggle)
|
||||
end
|
||||
|
||||
def privacy_policy_link
|
||||
link_to( t( '.footer_data_privacy_policy' ), Spree::Config.privacy_policy_url, target: '_blank' )
|
||||
end
|
||||
end
|
||||
@@ -140,8 +140,6 @@
|
||||
= t '.footer_legal_text_html', {content_license: link_to('CC BY-SA 3.0', 'https://creativecommons.org/licenses/by-sa/3.0/'), code_license: link_to('AGPL 3', 'https://tldrlegal.com/license/gnu-affero-general-public-license-v3-(agpl-3.0)' )}
|
||||
%p.text-small
|
||||
%div
|
||||
- cookies_policy_link = link_to( t( '.footer_data_cookies_policy' ), '', 'cookies-policy-modal' => true, 'cookies-banner' => !Web::CookiesConsent.new(cookies, request.host).exists? && Spree::Config.cookies_consent_banner_toggle)
|
||||
- privacy_policy_link = link_to( t( '.footer_data_privacy_policy' ), Spree::Config.privacy_policy_url, :target => '_blank' )
|
||||
- if Spree::Config.privacy_policy_url.present?
|
||||
= t '.footer_data_text_with_privacy_policy_html', {cookies_policy: cookies_policy_link.html_safe, privacy_policy: privacy_policy_link.html_safe }
|
||||
- else
|
||||
|
||||
Reference in New Issue
Block a user