From ca35c59e527ed24cd72e94b2a3a84ba09b699278 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Fri, 20 Jul 2018 15:20:26 +0100 Subject: [PATCH] Moved the footer TOS URL from the content settings to the new section legal settings in the global settings --- app/controllers/admin/contents_controller.rb | 2 +- app/models/content_configuration.rb | 1 - app/models/spree/app_configuration_decorator.rb | 1 + .../general_settings/edit/legal_settings.html.haml.deface | 3 +++ app/views/layouts/mailer.html.haml | 2 +- app/views/registration/steps/_introduction.html.haml | 2 +- app/views/shared/_footer.html.haml | 2 +- config/locales/en.yml | 1 - 8 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/controllers/admin/contents_controller.rb b/app/controllers/admin/contents_controller.rb index 87e8995ac3..188b74440f 100644 --- a/app/controllers/admin/contents_controller.rb +++ b/app/controllers/admin/contents_controller.rb @@ -8,7 +8,7 @@ module Admin {name: I18n.t('admin.contents.edit.group_signup_page'), preferences: [:group_signup_pricing_table_html, :group_signup_case_studies_html, :group_signup_detail_html]}, {name: I18n.t('admin.contents.edit.footer_and_external_links'), preferences: [:footer_logo, :footer_facebook_url, :footer_twitter_url, :footer_instagram_url, :footer_linkedin_url, :footer_googleplus_url, :footer_pinterest_url, - :footer_email, :community_forum_url, :footer_links_md, :footer_about_url, :footer_tos_url]}] + :footer_email, :community_forum_url, :footer_links_md, :footer_about_url]}] end def update diff --git a/app/models/content_configuration.rb b/app/models/content_configuration.rb index 47038bcb9e..2d65013a75 100644 --- a/app/models/content_configuration.rb +++ b/app/models/content_configuration.rb @@ -53,5 +53,4 @@ class ContentConfiguration < Spree::Preferences::FileConfiguration EOS preference :footer_about_url, :string, default: "http://www.openfoodnetwork.org/ofn-local/open-food-network-australia/" - preference :footer_tos_url, :string, default: "/Terms-of-service.pdf" end diff --git a/app/models/spree/app_configuration_decorator.rb b/app/models/spree/app_configuration_decorator.rb index 7eaedb1cce..9f9d051521 100644 --- a/app/models/spree/app_configuration_decorator.rb +++ b/app/models/spree/app_configuration_decorator.rb @@ -9,6 +9,7 @@ Spree::AppConfiguration.class_eval do preference :embedded_shopfronts_whitelist, :text, default: nil # Legal Preferences + preference :footer_tos_url, :string, default: "/Terms-of-service.pdf" preference :enterprises_require_tos, :boolean, default: false preference :privacy_policy_url, :string, default: nil preference :cookies_consent_banner_toggle, :boolean, default: false diff --git a/app/overrides/spree/admin/general_settings/edit/legal_settings.html.haml.deface b/app/overrides/spree/admin/general_settings/edit/legal_settings.html.haml.deface index caa8ca6c5e..d7368246b9 100644 --- a/app/overrides/spree/admin/general_settings/edit/legal_settings.html.haml.deface +++ b/app/overrides/spree/admin/general_settings/edit/legal_settings.html.haml.deface @@ -2,6 +2,9 @@ %fieldset.legal.no-border-bottom %legend{:align => "center"}= t('.legal_settings') + .field + = label_tag(:footer_tos_url, t(:footer_tos_url)) + tag(:br) + = preference_field_tag(:footer_tos_url, Spree::Config[:footer_tos_url], type: Spree::Config.preference_type(:footer_tos_url)) .field = preference_field_tag(:enterprises_require_tos, Spree::Config[:enterprises_require_tos], :type => Spree::Config.preference_type(:enterprises_require_tos)) = label_tag(:enterprises_require_tos, t('.enterprises_require_tos')) + tag(:br) diff --git a/app/views/layouts/mailer.html.haml b/app/views/layouts/mailer.html.haml index a00a35a5e0..7653ab5676 100644 --- a/app/views/layouts/mailer.html.haml +++ b/app/views/layouts/mailer.html.haml @@ -42,7 +42,7 @@ %tr %td{:align => "center"} %p - %a{:href => "#{ URI.join(spree.root_url, ContentConfig.footer_tos_url).to_s }", :target => "_blank"} + %a{:href => "#{ URI.join(spree.root_url, Spree::Config.footer_tos_url).to_s }", :target => "_blank"} = t :terms_of_service | %a{:href => "#{ spree.root_url }"} diff --git a/app/views/registration/steps/_introduction.html.haml b/app/views/registration/steps/_introduction.html.haml index 5c714cf1e5..f973ca055a 100644 --- a/app/views/registration/steps/_introduction.html.haml +++ b/app/views/registration/steps/_introduction.html.haml @@ -37,7 +37,7 @@ .small-12.medium-6.columns{'ng-hide' => '!tos_required' } %p.tos-message #{t(:enterprise_tos_message)} - %a{href: ContentConfig.footer_tos_url, target: "_blank" } #{t(:enterprise_tos_link_text)} + %a{href: Spree::Config.footer_tos_url, target: "_blank" } #{t(:enterprise_tos_link_text)} %p.tos-checkbox %input{ type: 'checkbox', name: 'accept_terms', id: 'accept_terms', ng: { model: "tos_accepted" } } %label{for: "accept_terms"} #{t(:enterprise_tos_agree)} diff --git a/app/views/shared/_footer.html.haml b/app/views/shared/_footer.html.haml index d8a48902dc..9c7126c999 100644 --- a/app/views/shared/_footer.html.haml +++ b/app/views/shared/_footer.html.haml @@ -131,7 +131,7 @@ .small-12.medium-5.columns.text-left %p.text-small = t '.footer_legal_call' - %a{href: ContentConfig.footer_tos_url} + %a{href: Spree::Config.footer_tos_url, target: "_blank"} = t '.footer_legal_tos' | = t '.footer_legal_visit' diff --git a/config/locales/en.yml b/config/locales/en.yml index f9a6fa032a..a7a828c45a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1183,7 +1183,6 @@ en: footer_email: "Email" footer_links_md: "Links" footer_about_url: "About URL" - footer_tos_url: "Terms of Service URL" name: Name first_name: First Name