From 0cf964e1bd654b29d85c2da0989201de6d0934d5 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Tue, 7 May 2019 11:23:48 +1000 Subject: [PATCH 1/4] Update About URL --- config/locales/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 36fa7c09b6..5f369889b1 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1275,7 +1275,7 @@ en: menu_4_title: "Groups" menu_4_url: "/groups" menu_5_title: "About" - menu_5_url: "http://www.openfoodnetwork.org/" + menu_5_url: "https://about.openfoodnetwork.org.au/" menu_6_title: "Connect" menu_6_url: "https://openfoodnetwork.org/au/connect/" menu_7_title: "Learn" From 38c9ecd44f225e2599963ac7c7ff7098a2edae9c Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Tue, 7 May 2019 12:23:33 +1000 Subject: [PATCH 2/4] Update pricing copy for Australian business model --- config/locales/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 5f369889b1..486040dcd1 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1761,7 +1761,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using sell_hubs_detail: "Set up a profile for your food enterprise or organisation on the OFN. At any time you can upgrade your profile to a multi-producer shop." sell_groups_detail: "Set up a tailored directory of enterprises (producers and other food enterprises) for your region or for your organisation." sell_user_guide: "Find out more in our user guide." - sell_listing_price: "Listing on the OFN is free. Opening and running a shop on OFN is free. Setting up a group directory on OFN for your organisation or regional network is free." + sell_listing_price: "Listing on the OFN is free. Opening and running a shop on OFN is free up to $500 of monthly sales. If you sell more you can choose your community contribution between 1% and 3% of sales. For more detail on pricing visit the Software Platform section via the About link in the top menu." sell_embed: "We can also embed an OFN shop in your own customised website or build a customised local food network website for your region." sell_ask_services: "Ask us about OFN services." From a3adbd9fc872434806174fe3e3cca5b2f704bbf2 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Tue, 7 May 2019 16:32:45 +1000 Subject: [PATCH 3/4] Replace connect-learn banner with custom content The connect and learn banner is only used in Australia at the moment. We would like to have customisable content here. Now every instance can choose to place a custom alert banner at the top. Unfortunately, custom banners are not translated into other languages. That's why I kept the standard register call. For example, the register call is in use where it is displayed in French and Italian. Completely switching to custom content would break the translation. Translations in custom content are an existing feature request, "multi-lang 2.0". --- app/models/content_configuration.rb | 14 ++++++++++++++ .../preference_sections/home_page_section.rb | 1 + app/views/shared/_connect_learn_call.html.haml | 12 ------------ app/views/shared/_page_alert.html.haml | 5 +++-- 4 files changed, 18 insertions(+), 14 deletions(-) delete mode 100644 app/views/shared/_connect_learn_call.html.haml diff --git a/app/models/content_configuration.rb b/app/models/content_configuration.rb index 3e1e2b0939..abac92f466 100644 --- a/app/models/content_configuration.rb +++ b/app/models/content_configuration.rb @@ -12,6 +12,20 @@ class ContentConfiguration < Spree::Preferences::FileConfiguration has_attached_file :logo_mobile_svg, default_url: "/assets/ofn-logo-mobile.svg" # Home page + # + # I intended to set a default for home_page_alert_html including I18n text. + # + # default: " + # #{I18n.t('shared.register_call.selling_on_ofn')}  + # #{I18n.t('shared.register_call.register')} + # + # " + # + # Unfortunately, this configuration is initialised and cached before locales + # are loaded. So I chose to not set a default and use a translatable view instead. + # All the following defaults using I18n don't work. + # https://github.com/openfoodfoundation/openfoodnetwork/issues/3816 + preference :home_page_alert_html, :text preference :home_hero, :file preference :home_show_stats, :boolean, default: true has_attached_file :home_hero, default_url: "/assets/home/home.jpg" diff --git a/app/models/preference_sections/home_page_section.rb b/app/models/preference_sections/home_page_section.rb index 05e58c5523..b050322689 100644 --- a/app/models/preference_sections/home_page_section.rb +++ b/app/models/preference_sections/home_page_section.rb @@ -6,6 +6,7 @@ module PreferenceSections def preferences [ + :home_page_alert_html, :home_hero, :home_show_stats ] diff --git a/app/views/shared/_connect_learn_call.html.haml b/app/views/shared/_connect_learn_call.html.haml deleted file mode 100644 index 68152b2b8f..0000000000 --- a/app/views/shared/_connect_learn_call.html.haml +++ /dev/null @@ -1,12 +0,0 @@ -:css - .page-alert .alert-box { background-color: #fdddac; } - -.alert-cta - %h6 - Open Food Network - %strong - = link_to t(:label_connect), "https://openfoodnetwork.org/au/connect/", target: '_blank' - and - %strong - = link_to t(:label_learn), "https://openfoodnetwork.org/au/learn/", target: '_blank' - \- Go exploring and get inspired! diff --git a/app/views/shared/_page_alert.html.haml b/app/views/shared/_page_alert.html.haml index 92def240e7..d57ef18d99 100644 --- a/app/views/shared/_page_alert.html.haml +++ b/app/views/shared/_page_alert.html.haml @@ -1,5 +1,6 @@ -- if feature? :connect_learn_homepage - = render "shared/connect_learn_call" +- if ContentConfig.home_page_alert_html.present? + .alert-cta + %h6= raw ContentConfig.home_page_alert_html - else = render "shared/register_call" From a97792cbc3bdc2d185f05d5b396c387c8a40fc12 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Thu, 9 May 2019 11:57:13 +1000 Subject: [PATCH 4/4] Remove story from code comment --- app/models/content_configuration.rb | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/app/models/content_configuration.rb b/app/models/content_configuration.rb index abac92f466..7b94504aed 100644 --- a/app/models/content_configuration.rb +++ b/app/models/content_configuration.rb @@ -12,25 +12,14 @@ class ContentConfiguration < Spree::Preferences::FileConfiguration has_attached_file :logo_mobile_svg, default_url: "/assets/ofn-logo-mobile.svg" # Home page - # - # I intended to set a default for home_page_alert_html including I18n text. - # - # default: " - # #{I18n.t('shared.register_call.selling_on_ofn')}  - # #{I18n.t('shared.register_call.register')} - # - # " - # - # Unfortunately, this configuration is initialised and cached before locales - # are loaded. So I chose to not set a default and use a translatable view instead. - # All the following defaults using I18n don't work. - # https://github.com/openfoodfoundation/openfoodnetwork/issues/3816 preference :home_page_alert_html, :text preference :home_hero, :file preference :home_show_stats, :boolean, default: true has_attached_file :home_hero, default_url: "/assets/home/home.jpg" # Producer sign-up page + # All the following defaults using I18n don't work. + # https://github.com/openfoodfoundation/openfoodnetwork/issues/3816 preference :producer_signup_pricing_table_html, :text, default: I18n.t(:content_configuration_pricing_table) preference :producer_signup_case_studies_html, :text, default: I18n.t(:content_configuration_case_studies) preference :producer_signup_detail_html, :text, default: I18n.t(:content_configuration_detail)