From 02b968b31285e053536d6ad4870fed389f308f04 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Wed, 29 Aug 2018 23:51:24 +0100 Subject: [PATCH] Cookies policy page table has a single column now. Also made small updates to the page text, migrated translations to ruby translations and extracted repeated partial from cookies policy page view --- .../stylesheets/darkswarm/branding.css.scss | 1 + .../darkswarm/cookies_policy_modal.css.scss | 11 +- app/helpers/cookies_policy_helper.rb | 8 + .../_cookies_policy_entry.html.haml | 13 ++ .../cookies_policy.html.haml | 188 +++++------------- config/locales/en.yml | 10 +- spec/features/consumer/cookies_spec.rb | 2 +- 7 files changed, 88 insertions(+), 145 deletions(-) create mode 100644 app/helpers/cookies_policy_helper.rb create mode 100644 app/views/angular_templates/_cookies_policy_entry.html.haml diff --git a/app/assets/stylesheets/darkswarm/branding.css.scss b/app/assets/stylesheets/darkswarm/branding.css.scss index 95a7da3069f..1a3393a17d5 100644 --- a/app/assets/stylesheets/darkswarm/branding.css.scss +++ b/app/assets/stylesheets/darkswarm/branding.css.scss @@ -25,6 +25,7 @@ $clr-blue-bright: #14b6cc; $clr-yellow-light: #faf6c7; +$disabled-very-light: #f5f5f5; $disabled-light: #e5e5e5; $disabled-bright: #ccc; $disabled-med: #b3b3b3; diff --git a/app/assets/stylesheets/darkswarm/cookies_policy_modal.css.scss b/app/assets/stylesheets/darkswarm/cookies_policy_modal.css.scss index 5c27e27a76b..029cf1f2119 100644 --- a/app/assets/stylesheets/darkswarm/cookies_policy_modal.css.scss +++ b/app/assets/stylesheets/darkswarm/cookies_policy_modal.css.scss @@ -5,8 +5,15 @@ border-bottom-color: $disabled-light; table { - display: block; - overflow-x: auto; + width: 100%; + + tr:nth-of-type(even) { + background-color: $disabled-very-light; + } + + p { + margin-bottom: .25rem; + } } &.fade { diff --git a/app/helpers/cookies_policy_helper.rb b/app/helpers/cookies_policy_helper.rb new file mode 100644 index 00000000000..2afd28d9db9 --- /dev/null +++ b/app/helpers/cookies_policy_helper.rb @@ -0,0 +1,8 @@ +module CookiesPolicyHelper + def render_cookie_entry(cookie_name, cookie_desc, cookie_domain = nil) + render partial: 'cookies_policy_entry', + locals: { cookie_name: cookie_name, + cookie_desc: cookie_desc, + cookie_domain: cookie_domain } + end +end diff --git a/app/views/angular_templates/_cookies_policy_entry.html.haml b/app/views/angular_templates/_cookies_policy_entry.html.haml new file mode 100644 index 00000000000..ad83c7ed235 --- /dev/null +++ b/app/views/angular_templates/_cookies_policy_entry.html.haml @@ -0,0 +1,13 @@ +%tr + %td + %p + %strong + = cookie_name + %span / + = t 'legal.cookies_policy.cookie_domain' + - if cookie_domain + = cookie_domain + - else + = "{{ instance_hostname }}" + %p + = cookie_desc diff --git a/app/views/angular_templates/cookies_policy.html.haml b/app/views/angular_templates/cookies_policy.html.haml index aaef3324c7c..e43d1ded9ed 100644 --- a/app/views/angular_templates/cookies_policy.html.haml +++ b/app/views/angular_templates/cookies_policy.html.haml @@ -1,177 +1,93 @@ %h2 - {{ 'legal.cookies_policy.header' | t}} + = t 'legal.cookies_policy.header' %p - {{ 'legal.cookies_policy.desc_part_1' | t}} + = t 'legal.cookies_policy.desc_part_1' %p - {{ 'legal.cookies_policy.desc_part_2' | t}} + = t 'legal.cookies_policy.desc_part_2' %p - {{ 'legal.cookies_policy.desc_part_3' | t}} + = t 'legal.cookies_policy.desc_part_3' %h2 - {{ 'legal.cookies_policy.essential_cookies' | t}} + = t 'legal.cookies_policy.essential_cookies' %p - {{ 'legal.cookies_policy.essential_cookies_desc' | t}} + = t 'legal.cookies_policy.essential_cookies_desc' %table{ng: { controller:"CookiesPolicyModalCtrl"}} + = render_cookie_entry( "_session_id", t( "legal.cookies_policy.cookie_session_desc" ) ) + = render_cookie_entry( "cookies_consent", t( "legal.cookies_policy.cookie_consent_desc" ) ) + = render_cookie_entry( "remember_spree_user_token", t( "legal.cookies_policy.cookie_remember_me_desc" ) ) + = render_cookie_entry( "qos_token", t( "legal.cookies_policy.cookie_openstreemap_desc" ), "openstreetmap.org" ) %tr - %th - {{ 'legal.cookies_policy.cookie_name' | t}} - %th - {{ 'legal.cookies_policy.cookie_domain' | t}} - %th - {{ 'legal.cookies_policy.cookie_desc' | t}} - %tr - %td - _session_id - %td - {{ instance_hostname }} - %td - {{ 'legal.cookies_policy.cookie_session_desc' | t}} - %tr - %td - cookies_consent - %td - {{ instance_hostname }} - %td - {{ 'legal.cookies_policy.cookie_consent_desc' | t}} - %tr - %td - remember_spree_user_token - %td - {{ instance_hostname }} - %td - {{ 'legal.cookies_policy.cookie_remember_me_desc' | t}} - %tr - %td - qos_token - %td - openstreetmap.org - %td - {{ 'legal.cookies_policy.cookie_openstreemap_desc' | t}} - %tr - %td - m - %td - m.stripe.com - %td{rowspan:"4"} - {{ 'legal.cookies_policy.cookie_stripe_desc' | t}} - %tr - %td - nsr - %td - m.stripe.network - %tr - %td - __stripe_sid - %td - {{ instance_hostname }} - %tr - %td - __stripe_mid %td - {{ instance_hostname }} + %p + %strong m + %span / + = t 'legal.cookies_policy.cookie_domain' + = "m.stripe.com" + %p + %strong nsr + %span / + = t 'legal.cookies_policy.cookie_domain' + = "m.stripe.network" + %p + %strong __stripe_sid + %span / + = t 'legal.cookies_policy.cookie_domain' + = "{{ instance_hostname }}" + %p + %strong __stripe_mid + %span / + = t 'legal.cookies_policy.cookie_domain' + = "{{ instance_hostname }}" + %p + = t 'legal.cookies_policy.cookie_stripe_desc' %p - {{ 'legal.cookies_policy.essential_cookies_note' | t}} + = t 'legal.cookies_policy.essential_cookies_note' - if Spree::Config.cookies_policy_matomo_section || Spree::Config.cookies_policy_ga_section %h2 - {{ 'legal.cookies_policy.statistics_cookies' | t}} + = t 'legal.cookies_policy.statistics_cookies' %p - {{ 'legal.cookies_policy.statistics_cookies_desc' | t}} + = t 'legal.cookies_policy.statistics_cookies_desc' - if Spree::Config.cookies_policy_ga_section %p - {{ 'legal.cookies_policy.statistics_cookies_analytics_desc' | t}} + = t 'legal.cookies_policy.statistics_cookies_analytics_desc_html' - if Spree::Config.cookies_policy_matomo_section %p - {{ 'legal.cookies_policy.statistics_cookies_matomo_desc' | t}} + = t 'legal.cookies_policy.statistics_cookies_matomo_desc_html' %table{ng: { controller:"CookiesPolicyModalCtrl"}} - %tr - %th - {{ 'legal.cookies_policy.cookie_name' | t}} - %th - {{ 'legal.cookies_policy.cookie_domain' | t}} - %th - {{ 'legal.cookies_policy.cookie_desc' | t}} - if Spree::Config.cookies_policy_ga_section - %tr - %td - __utma - %td - {{ instance_hostname }} - %td - {{ 'legal.cookies_policy.cookie_analytics_utma_desc' | t}} - %tr - %td - __utmt - %td - {{ instance_hostname }} - %td - {{ 'legal.cookies_policy.cookie_analytics_utmt_desc' | t}} - %tr - %td - __utmb - %td - {{ instance_hostname }} - %td - {{ 'legal.cookies_policy.cookie_analytics_utmb_desc' | t}} - %tr - %td - __utmc - %td - {{ instance_hostname }} - %td - {{ 'legal.cookies_policy.cookie_analytics_utmc_desc' | t}} - %tr - %td - __utmz - %td - {{ instance_hostname }} - %td - {{ 'legal.cookies_policy.cookie_analytics_utmz_desc' | t}} + = render_cookie_entry( "__utma", t( "legal.cookies_policy.cookie_analytics_utma_desc" ) ) + = render_cookie_entry( "__utmt", t( "legal.cookies_policy.cookie_analytics_utmt_desc" ) ) + = render_cookie_entry( "__utmb", t( "legal.cookies_policy.cookie_analytics_utmb_desc" ) ) + = render_cookie_entry( "__utmc", t( "legal.cookies_policy.cookie_analytics_utmc_desc" ) ) + = render_cookie_entry( "__utmz", t( "legal.cookies_policy.cookie_analytics_utmz_desc" ) ) - if Spree::Config.cookies_policy_matomo_section - %tr - %td - _pk_ref, _pk_cvar, _pk_id and _pk_ses - %td - {{ instance_hostname }} - %td - {{ 'legal.cookies_policy.cookie_matomo_basics_desc' | t}} - %tr - %td - _pk_hsr - %td - {{ instance_hostname }} - %td - {{ 'legal.cookies_policy.cookie_matomo_heatmap_desc' | t}} - %tr - %td - piwik_ignore - %td - {{ instance_hostname }} - %td - {{ 'legal.cookies_policy.cookie_matomo_ignore_desc' | t}} + = render_cookie_entry( "_pk_ref, _pk_cvar, _pk_id and _pk_ses", t( "legal.cookies_policy.cookie_matomo_basics_desc" ) ) + = render_cookie_entry( "_pk_hsr, _pk_cvar, _pk_id and _pk_ses", t( "legal.cookies_policy.cookie_matomo_heatmap_desc" ) ) + = render_cookie_entry( "piwik_ignore, _pk_cvar, _pk_id and _pk_ses", t( "legal.cookies_policy.cookie_matomo_ignore_desc" ) ) %h2 - {{ 'legal.cookies_policy.disabling_cookies_header' | t}} + = t 'legal.cookies_policy.disabling_cookies_header' %p - {{ 'legal.cookies_policy.disabling_cookies_desc' | t}} + = t 'legal.cookies_policy.disabling_cookies_desc' %ul %li - %a{ href: "{{'legal.cookies_policy.disabling_cookies_firefox_link' | t}}", target: "_blank" } + %a{ href: t( 'legal.cookies_policy.disabling_cookies_firefox_link' ), target: "_blank" } Firefox %li - %a{ href: "{{ 'legal.cookies_policy.disabling_cookies_chrome_link' | t}}", target: "_blank" } + %a{ href: t( 'legal.cookies_policy.disabling_cookies_chrome_link' ), target: "_blank" } Chrome %li - %a{ href: "{{ 'legal.cookies_policy.disabling_cookies_ie_link' | t}}", target: "_blank" } + %a{ href: t( 'legal.cookies_policy.disabling_cookies_ie_link' ), target: "_blank" } Internet Explorer %li - %a{ href: "{{ 'legal.cookies_policy.disabling_cookies_safari_link' | t}}", target: "_blank" } + %a{ href: t( 'legal.cookies_policy.disabling_cookies_safari_link' ), target: "_blank" } Safari %p - {{ 'legal.cookies_policy.disabling_cookies_note' | t}} + = t 'legal.cookies_policy.disabling_cookies_note' %a.close-reveal-modal{"ng-click" => "$close()"} %i.ofn-i_009-close diff --git a/config/locales/en.yml b/config/locales/en.yml index 540d306a953..7f415285ef9 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1273,18 +1273,16 @@ en: essential_cookies: "Essential Cookies" essential_cookies_desc: "The following cookies are strictly necessary for the operation of our website." essential_cookies_note: "Most cookies only contain a unique identifier, but no other data, so your email address and password for instance are never contained in them and never exposed." - cookie_name: "Cookie Name" - cookie_domain: "Set By" - cookie_desc: "Description" + cookie_domain: "Set By:" cookie_session_desc: "Used to allow the website to remember users between page visits, for example, remember items in your cart." cookie_consent_desc: "Used to maintain status of user consent to store cookies" cookie_remember_me_desc: "Used if the user has requested the website to remember him. This cookie is automatically deleted after 12 days. If as a user you want that cookie to be deleted, you only need to logout. If you don’t want that cookie to be installed on your computer you shouldn’t check the “remember me” checkbox when logging in." cookie_openstreemap_desc: "Used by our friendly open source mapping provider (OpenStreetMap) to ensure that it does not receive too many requests during a given time period, to prevent abuse of their services." cookie_stripe_desc: "Data collected by our payment processor Stripe for fraud detection https://stripe.com/cookies-policy/legal. Not all shops use Stripe as a payment method but it is a good practice to prevent fraud to apply it to all pages. Stripe probably build a picture of which of our pages usually interact with their API and then flag anything unusual. So setting the Stripe cookie has a broader function than simply the provision of a payment method to a user. Removing it could affect the security of the service itself. You can learn more about Stripe and read its privacy policy at https://stripe.com/privacy." statistics_cookies: "Statistics Cookies" - statistics_cookies_desc: "The following are not Strictly Necessary, but help to provide you with the best user experience by allowing us to analyse user behaviour, identify which features you use most, or don’t use, understand user experience issues, etc." - statistics_cookies_analytics_desc: "We use Google Analytics, as it was the default service connected with Spree (the e-commerce open source software that we built on) but our vision is to switch to Matomo (ex Piwik, open source analytics tool) as soon as we can." - statistics_cookies_matomo_desc: "We use Matomo (ex Piwik), an open source analytics tool." + statistics_cookies_desc: "The following are not strictly necessary, but help to provide you with the best user experience by allowing us to analyse user behaviour, identify which features you use most, or don’t use, understand user experience issues, etc." + statistics_cookies_analytics_desc_html: "To collect and analyse platform usage data, we use Google Analytics, as it was the default service connected with Spree (the e-commerce open source software that we built on) but our vision is to switch to Matomo (ex Piwik, open source analytics tool that is GDPR compliant and protects your privacy) as soon as we can." + statistics_cookies_matomo_desc_html: "To collect and analyse platform usage data, we use Matomo (ex Piwik), an open source analytics tool that is GDPR compliant and protects your privacy." cookie_analytics_utma_desc: "Used to distinguish users and sessions. The cookie is created when the javascript library executes and no existing __utma cookies exists. The cookie is updated every time data is sent to Google Analytics." cookie_analytics_utmt_desc: "Used to throttle request rate." cookie_analytics_utmb_desc: "Used to determine new sessions/visits. The cookie is created when the javascript library executes and no existing __utmb cookies exists. The cookie is updated every time data is sent to Google Analytics." diff --git a/spec/features/consumer/cookies_spec.rb b/spec/features/consumer/cookies_spec.rb index 8401c17ce90..886593ab328 100644 --- a/spec/features/consumer/cookies_spec.rb +++ b/spec/features/consumer/cookies_spec.rb @@ -76,7 +76,7 @@ end def matomo_description_text - I18n.t('legal.cookies_policy.statistics_cookies_matomo_desc') + I18n.t('legal.cookies_policy.cookie_matomo_basics_desc') end def expect_visible_cookies_policy_page