From 5fd3dc1d283bb37a6637a2f07ef44ab60ce192ec Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Fri, 17 Jul 2015 16:24:07 +1000 Subject: [PATCH] Customise footer logo --- app/controllers/admin/contents_controller.rb | 3 ++- app/models/content_configuration.rb | 5 ++++- app/views/shared/_footer.html.haml | 2 +- config/locales/en.yml | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/controllers/admin/contents_controller.rb b/app/controllers/admin/contents_controller.rb index d1c761d4ad..0b5012244d 100644 --- a/app/controllers/admin/contents_controller.rb +++ b/app/controllers/admin/contents_controller.rb @@ -6,7 +6,8 @@ module Admin {name: 'Producer signup page', preferences: [:producer_signup_pricing_table_html, :producer_signup_case_studies_html, :producer_signup_detail_html]}, {name: 'Hub signup page', preferences: [:hub_signup_pricing_table_html, :hub_signup_case_studies_html, :hub_signup_detail_html]}, {name: 'Group signup page', preferences: [:group_signup_pricing_table_html, :group_signup_case_studies_html, :group_signup_detail_html]}, - {name: 'Footer', preferences: [:footer_facebook_url, :footer_twitter_url, :footer_instagram_url, :footer_linkedin_url, :footer_googleplus_url, :footer_pinterest_url, + {name: 'Footer', preferences: [:footer_logo, + :footer_facebook_url, :footer_twitter_url, :footer_instagram_url, :footer_linkedin_url, :footer_googleplus_url, :footer_pinterest_url, :footer_email, :footer_links_md, :footer_about_url]}] end diff --git a/app/models/content_configuration.rb b/app/models/content_configuration.rb index de43c2f7a6..32bb66b3ac 100644 --- a/app/models/content_configuration.rb +++ b/app/models/content_configuration.rb @@ -1,8 +1,9 @@ require 'open_food_network/paperclippable' class ContentConfiguration < Spree::Preferences::FileConfiguration - # Header include OpenFoodNetwork::Paperclippable + + # Header preference :logo, :file preference :logo_mobile, :file preference :logo_mobile_svg, :file @@ -31,6 +32,8 @@ class ContentConfiguration < Spree::Preferences::FileConfiguration preference :group_signup_detail_html, :text, default: "(TODO: Detail)" # Footer + preference :footer_logo, :file + has_attached_file :footer_logo preference :footer_facebook_url, :string, default: "https://www.facebook.com/OpenFoodNet" preference :footer_twitter_url, :string, default: "https://twitter.com/OpenFoodNet" preference :footer_instagram_url, :string, default: "" diff --git a/app/views/shared/_footer.html.haml b/app/views/shared/_footer.html.haml index de9d9e341a..db6c797570 100644 --- a/app/views/shared/_footer.html.haml +++ b/app/views/shared/_footer.html.haml @@ -116,7 +116,7 @@ .row .small-12.medium-3.medium-offset-2.columns.text-left %a{href: root_path} - %img{src: "/assets/logo-color.png", srcset: "/assets/logo-color.svg", width: "220px"} + %img{src: ContentConfig.footer_logo.url, width: "220"} .small-12.medium-5.columns.text-left %p.text-small Read our diff --git a/config/locales/en.yml b/config/locales/en.yml index 6454f1b33a..f7c23bee4d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -25,6 +25,7 @@ en: logo_mobile_svg: "Mobile logo (SVG)" home_hero: "Hero image" home_show_stats: "Show statistics" + footer_logo: "Logo (220x76)" footer_facebook_url: "Facebook URL" footer_twitter_url: "Twitter URL" footer_instagram_url: "Instagram URL"