From 2cdf458d6ae498a7c5f267a86dacbb7f22d928aa Mon Sep 17 00:00:00 2001 From: Rob H Date: Thu, 14 Feb 2013 15:42:47 +1100 Subject: [PATCH] Move additional of tabs to main nav bar to defaces, rather than overriding view directly --- app/overrides/add_cms_tabs_to_main_nav_bar.rb | 5 +++++ .../add_current_distributor_to_main_nav_bar.rb | 5 +++++ app/views/spree/shared/_cms_tabs.html.haml | 3 +++ .../spree/shared/_current_distributor.html.haml | 4 ++++ app/views/spree/shared/_store_menu.html.haml | 14 -------------- 5 files changed, 17 insertions(+), 14 deletions(-) create mode 100644 app/overrides/add_cms_tabs_to_main_nav_bar.rb create mode 100644 app/overrides/add_current_distributor_to_main_nav_bar.rb create mode 100644 app/views/spree/shared/_cms_tabs.html.haml create mode 100644 app/views/spree/shared/_current_distributor.html.haml delete mode 100644 app/views/spree/shared/_store_menu.html.haml diff --git a/app/overrides/add_cms_tabs_to_main_nav_bar.rb b/app/overrides/add_cms_tabs_to_main_nav_bar.rb new file mode 100644 index 0000000000..47d67141f7 --- /dev/null +++ b/app/overrides/add_cms_tabs_to_main_nav_bar.rb @@ -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') \ No newline at end of file diff --git a/app/overrides/add_current_distributor_to_main_nav_bar.rb b/app/overrides/add_current_distributor_to_main_nav_bar.rb new file mode 100644 index 0000000000..371b09247e --- /dev/null +++ b/app/overrides/add_current_distributor_to_main_nav_bar.rb @@ -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') \ No newline at end of file diff --git a/app/views/spree/shared/_cms_tabs.html.haml b/app/views/spree/shared/_cms_tabs.html.haml new file mode 100644 index 0000000000..1921e8cfac --- /dev/null +++ b/app/views/spree/shared/_cms_tabs.html.haml @@ -0,0 +1,3 @@ +- if @cms_site + - @cms_site.pages.root.children.published.each do |page| + %li= link_to page.label, page.full_path \ No newline at end of file diff --git a/app/views/spree/shared/_current_distributor.html.haml b/app/views/spree/shared/_current_distributor.html.haml new file mode 100644 index 0000000000..1b556e7e4f --- /dev/null +++ b/app/views/spree/shared/_current_distributor.html.haml @@ -0,0 +1,4 @@ +- if current_distributor + %li#current-distributor{'data-hook' => ''} + You are shopping at + = link_to current_distributor.name, root_path \ No newline at end of file diff --git a/app/views/spree/shared/_store_menu.html.haml b/app/views/spree/shared/_store_menu.html.haml deleted file mode 100644 index 1e1a2ba67e..0000000000 --- a/app/views/spree/shared/_store_menu.html.haml +++ /dev/null @@ -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