mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-31 21:37:16 +00:00
Allow overriding mobile logo (raster and SVG) and home hero image
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
module Admin
|
||||
class ContentsController < Spree::Admin::BaseController
|
||||
def edit
|
||||
@preference_sections = [{name: 'Header', preferences: [:logo]},
|
||||
{name: 'Home page', preferences: [:home_show_stats]},
|
||||
@preference_sections = [{name: 'Header', preferences: [:logo, :logo_mobile, :logo_mobile_svg]},
|
||||
{name: 'Home page', preferences: [:home_hero, :home_show_stats]},
|
||||
{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]},
|
||||
|
||||
@@ -4,10 +4,16 @@ class ContentConfiguration < Spree::Preferences::FileConfiguration
|
||||
# Header
|
||||
include OpenFoodNetwork::Paperclippable
|
||||
preference :logo, :file
|
||||
preference :logo_mobile, :file
|
||||
preference :logo_mobile_svg, :file
|
||||
has_attached_file :logo
|
||||
has_attached_file :logo_mobile
|
||||
has_attached_file :logo_mobile_svg
|
||||
|
||||
# Home page
|
||||
preference :home_show_stats, :boolean, default: true
|
||||
preference :home_hero, :file
|
||||
has_attached_file :home_hero
|
||||
|
||||
# Producer sign-up page
|
||||
preference :producer_signup_pricing_table_html, :text, default: "(TODO: Pricing table)"
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
module Spree::Preferences
|
||||
Configuration.class_eval do
|
||||
end
|
||||
end
|
||||
@@ -1,3 +1,7 @@
|
||||
:css
|
||||
#tagline:before { background-image: url("#{ContentConfig.home_hero.url}") }
|
||||
|
||||
|
||||
%div{"ng-controller" => "HomeCtrl"}
|
||||
= render partial: "shared/menu/alert"
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
%section.left
|
||||
.ofn-logo
|
||||
%a{href: root_path}
|
||||
%img{src: "/assets/logo-black.png", srcset: "/assets/logo-black.svg", width: "75", height: "26"}
|
||||
%img{src: ContentConfig.logo_mobile.url, srcset: ContentConfig.logo_mobile_svg.url, width: "75", height: "26"}
|
||||
|
||||
%section.right{"ng-cloak" => true}
|
||||
.cart
|
||||
@@ -18,7 +18,7 @@
|
||||
%ul.off-canvas-list
|
||||
%li.ofn-logo
|
||||
%a{href: root_path}
|
||||
%img{src: "/assets/logo-black.png", srcset: "/assets/logo-black.svg", width: "75", height: "26"}
|
||||
%img{src: ContentConfig.logo_mobile.url, srcset: ContentConfig.logo_mobile_svg.url, width: "75", height: "26"}
|
||||
%li.li-menu
|
||||
- if current_page? main_app.shops_path
|
||||
%a{"ofn-scroll-to" => "hubs"}
|
||||
|
||||
Reference in New Issue
Block a user