From 8b4c0682fbe7d08c141906e2aafc4b7f4825ee3d Mon Sep 17 00:00:00 2001 From: alexs Date: Wed, 21 Aug 2013 16:05:06 +1000 Subject: [PATCH] Replaced eaterprises logo with the distributor name header. --- app/assets/stylesheets/store/openfoodweb.css.scss | 5 +++++ .../add_current_distribution_to_main_nav_bar.rb | 5 ----- .../_header/replace_logo_with_link_text.html.haml.deface | 8 ++++++++ app/views/spree/shared/_current_distribution.html.haml | 9 --------- spec/features/consumer/add_to_cart_spec.rb | 9 ++++----- spec/features/consumer/browse_products_spec.rb | 4 ++-- 6 files changed, 19 insertions(+), 21 deletions(-) delete mode 100644 app/overrides/add_current_distribution_to_main_nav_bar.rb create mode 100644 app/overrides/spree/shared/_header/replace_logo_with_link_text.html.haml.deface delete mode 100644 app/views/spree/shared/_current_distribution.html.haml diff --git a/app/assets/stylesheets/store/openfoodweb.css.scss b/app/assets/stylesheets/store/openfoodweb.css.scss index 93017a3e58..cf35a29486 100644 --- a/app/assets/stylesheets/store/openfoodweb.css.scss +++ b/app/assets/stylesheets/store/openfoodweb.css.scss @@ -16,6 +16,7 @@ table { } #header #logo { + margin-top: 10px; padding-top: 10px; } @@ -295,3 +296,7 @@ div#eft-payment-alert { div.cleared { clear: both; } + +#link-to-login { + padding: 10px; +} diff --git a/app/overrides/add_current_distribution_to_main_nav_bar.rb b/app/overrides/add_current_distribution_to_main_nav_bar.rb deleted file mode 100644 index 9f7f0cd4b2..0000000000 --- a/app/overrides/add_current_distribution_to_main_nav_bar.rb +++ /dev/null @@ -1,5 +0,0 @@ -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_distribution", - :original => '0d843946b3a53643c5a7da90a3a21610208db866') diff --git a/app/overrides/spree/shared/_header/replace_logo_with_link_text.html.haml.deface b/app/overrides/spree/shared/_header/replace_logo_with_link_text.html.haml.deface new file mode 100644 index 0000000000..a701f63146 --- /dev/null +++ b/app/overrides/spree/shared/_header/replace_logo_with_link_text.html.haml.deface @@ -0,0 +1,8 @@ +/ + replace "#logo" + +%figure#logo.columns.six + - if current_distributor + %h1= link_to current_distributor.name, main_app.shop_enterprise_path(current_distributor) + - else + %h1= link_to "OPEN FOOD NETWORK", root_path diff --git a/app/views/spree/shared/_current_distribution.html.haml b/app/views/spree/shared/_current_distribution.html.haml deleted file mode 100644 index 9f47ed6592..0000000000 --- a/app/views/spree/shared/_current_distribution.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -- if current_distributor || current_order_cycle - %li#current-distribution{'data-hook' => ''} - You are shopping - - if current_distributor - at - = link_to current_distributor.name, root_path - - if current_order_cycle - in - = link_to current_order_cycle.name, root_path diff --git a/spec/features/consumer/add_to_cart_spec.rb b/spec/features/consumer/add_to_cart_spec.rb index 259c21fe1a..a2a677f556 100644 --- a/spec/features/consumer/add_to_cart_spec.rb +++ b/spec/features/consumer/add_to_cart_spec.rb @@ -87,7 +87,7 @@ feature %q{ visit spree.cart_path page.should have_selector 'h4 a', :text => p1.name page.should have_selector 'h4 a', :text => p2.name - page.should have_selector "#current-distribution a", :text => d2.name + page.should have_selector "#logo h1 a", :text => d2.name end it "when the only valid distributor is the chosen one, does not allow the user to choose a distributor" do @@ -135,7 +135,7 @@ feature %q{ click_button 'Add To Cart' # Then My distributor should have changed - page.should have_selector "#current-distribution a", :text => d2.name + page.should have_selector "#logo h1 a", :text => d2.name end it "does not allow the user to add a product from a distributor that cannot supply the cart's products" do @@ -295,8 +295,7 @@ feature %q{ visit spree.cart_path page.should have_selector 'h4 a', :text => p1.name page.should have_selector 'h4 a', :text => p2.name - page.should have_selector "#current-distribution a", :text => d2.name - page.should have_selector "#current-distribution a", :text => oc2.name + page.should have_selector "#logo h1 a", :text => d2.name end it "when the only valid order cycle is the chosen one, does not allow the user to choose an order cycle" do @@ -353,7 +352,7 @@ feature %q{ click_button 'Add To Cart' # Then my distributor should have changed - page.should have_selector "#current-distribution a", :text => d2.name + page.should have_selector "#logo h1 a", :text => d2.name end it "does not allow the user to add a product from an order cycle that cannot supply the cart's products" do diff --git a/spec/features/consumer/browse_products_spec.rb b/spec/features/consumer/browse_products_spec.rb index fbc5113efe..272937c1c6 100644 --- a/spec/features/consumer/browse_products_spec.rb +++ b/spec/features/consumer/browse_products_spec.rb @@ -35,7 +35,7 @@ feature %q{ click_on "Melb Uni Co-op" # Then I should see the name of the distributor that I've selected - page.should have_content 'You are shopping at Melb Uni Co-op' + page.should have_content 'Melb Uni Co-op' page.should_not have_selector 'div.distributor-description' end @@ -137,7 +137,7 @@ feature %q{ click_button 'Add To Cart' # Then I should see the name of the distributor and order cycle that I've selected - page.should have_content 'You are shopping at Melb Uni Co-op in Bulk Foods' + page.should have_content 'Melb Uni Co-op' page.should_not have_selector 'div.distributor-description' end