Skip to content

Commit

Permalink
Moved the footer TOS URL from the content settings to the new section…
Browse files Browse the repository at this point in the history
… legal settings in the global settings
  • Loading branch information
luisramos0 committed Jul 20, 2018
1 parent 1fca20e commit 83f5d8d
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/controllers/admin/contents_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion app/models/content_configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions app/models/spree/app_configuration_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/mailer.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }"}
Expand Down
2 changes: 1 addition & 1 deletion app/views/registration/steps/_introduction.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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)}
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/_footer.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
&#124;
= t :footer_legal_visit
Expand Down
2 changes: 1 addition & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 "
Expand Down

0 comments on commit 83f5d8d

Please sign in to comment.