mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-02 21:57:17 +00:00
Move additional of tabs to main nav bar to defaces, rather than overriding view directly
This commit is contained in:
5
app/overrides/add_cms_tabs_to_main_nav_bar.rb
Normal file
5
app/overrides/add_cms_tabs_to_main_nav_bar.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
Deface::Override.new(:virtual_path => "spree/shared/_main_nav_bar",
|
||||
:name => "add_cms_tabs_to_main_nav_bar",
|
||||
:insert_after => "li#home-link",
|
||||
:partial => "spree/shared/cms_tabs",
|
||||
:original => '05c6495f8760e58eb68e2cce67433cf7f5299fa4')
|
||||
5
app/overrides/add_current_distributor_to_main_nav_bar.rb
Normal file
5
app/overrides/add_current_distributor_to_main_nav_bar.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
Deface::Override.new(:virtual_path => "spree/shared/_main_nav_bar",
|
||||
:name => "add_current_distributor_to_main_nav_bar",
|
||||
:insert_after => "li#link-to-cart",
|
||||
:partial => "spree/shared/current_distributor",
|
||||
:original => '0d843946b3a53643c5a7da90a3a21610208db866')
|
||||
3
app/views/spree/shared/_cms_tabs.html.haml
Normal file
3
app/views/spree/shared/_cms_tabs.html.haml
Normal file
@@ -0,0 +1,3 @@
|
||||
- if @cms_site
|
||||
- @cms_site.pages.root.children.published.each do |page|
|
||||
%li= link_to page.label, page.full_path
|
||||
4
app/views/spree/shared/_current_distributor.html.haml
Normal file
4
app/views/spree/shared/_current_distributor.html.haml
Normal file
@@ -0,0 +1,4 @@
|
||||
- if current_distributor
|
||||
%li#current-distributor{'data-hook' => ''}
|
||||
You are shopping at
|
||||
= link_to current_distributor.name, root_path
|
||||
@@ -1,14 +0,0 @@
|
||||
%li#home-link{'data-hook' => ''}
|
||||
= link_to t(:home), root_path
|
||||
|
||||
- if @cms_site
|
||||
- @cms_site.pages.root.children.published.each do |page|
|
||||
%li= link_to page.label, page.full_path
|
||||
|
||||
%li#link-to-cart{'data-hook' => ''}
|
||||
= link_to_cart
|
||||
|
||||
- if current_distributor
|
||||
%li#current-distributor{'data-hook' => ''}
|
||||
You are shopping at
|
||||
= link_to current_distributor.name, root_path
|
||||
Reference in New Issue
Block a user