diff --git a/app/controllers/admin/contents_controller.rb b/app/controllers/admin/contents_controller.rb index 87e8995ac312..188b74440ff2 100644 --- a/app/controllers/admin/contents_controller.rb +++ b/app/controllers/admin/contents_controller.rb @@ -8,7 +8,7 @@ def edit {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 47038bcb9e95..2d65013a75fb 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 f8d6d550fc29..5100e4b13e02 100644 --- a/app/models/spree/app_configuration_decorator.rb +++ b/app/models/spree/app_configuration_decorator.rb @@ -9,6 +9,7 @@ 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 6dfd9d5e0233..7acfffca7ce9 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 a00a35a5e096..7653ab567667 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 5c714cf1e59d..f973ca055a18 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 ddfb1fe90d4a..d6ace1164e11 100644 --- a/app/views/shared/_footer.html.haml +++ b/app/views/shared/_footer.html.haml @@ -132,7 +132,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 d39d64a26b50..eeaf3953a4e5 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1139,7 +1139,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 @@ -2085,6 +2084,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using legal_settings: "Legal Settings" cookies_consent_banner_toggle: "Display cookies consent banner" privacy_policy_url: "Privacy Policy URL" + footer_tos_url: "Terms of Service URL" enterprises_require_tos: "Enterprises must accept Terms of Service" enterprise_tos_link: "Enterprise Terms of Service link" enterprise_tos_message: "We want to work with people that share our aims and values. As such we ask new enterprises to agree to our "