diff --git a/app/overrides/spree/admin/shared/_head/replace_spree_title.html.haml.deface b/app/overrides/spree/admin/shared/_head/replace_spree_title.html.haml.deface index 4b9bd4142d..906a09bd8c 100644 --- a/app/overrides/spree/admin/shared/_head/replace_spree_title.html.haml.deface +++ b/app/overrides/spree/admin/shared/_head/replace_spree_title.html.haml.deface @@ -1,4 +1,7 @@ / replace_contents "title" -= t(controller.controller_name, :default => controller.controller_name.titleize) -= " - OFN #{t(:administration)}" \ No newline at end of file +- if content_for? :html_title + = yield :html_title +- else + = t(controller.controller_name, :default => controller.controller_name.titleize) += " - OFN #{t(:administration)}" diff --git a/app/overrides/spree/admin/shared/_product_sub_menu/add_variant_overrides_tab.html.haml.deface b/app/overrides/spree/admin/shared/_product_sub_menu/add_variant_overrides_tab.html.haml.deface index 8db108b4f2..f0e507234a 100644 --- a/app/overrides/spree/admin/shared/_product_sub_menu/add_variant_overrides_tab.html.haml.deface +++ b/app/overrides/spree/admin/shared/_product_sub_menu/add_variant_overrides_tab.html.haml.deface @@ -1,3 +1,3 @@ / insert_bottom "[data-hook='admin_product_sub_tabs']" -= tab :variant_overrides, label: "Overrides", url: main_app.admin_variant_overrides_path, match_path: '/variant_overrides' += tab :variant_overrides, label: "Inventory", url: main_app.admin_inventory_path, match_path: '/inventory' diff --git a/app/views/admin/enterprises/form/_inventory_settings.html.haml b/app/views/admin/enterprises/form/_inventory_settings.html.haml index ded4f6d497..6a6c079409 100644 --- a/app/views/admin/enterprises/form/_inventory_settings.html.haml +++ b/app/views/admin/enterprises/form/_inventory_settings.html.haml @@ -5,7 +5,7 @@ .alpha.eleven.columns You can opt to use your %strong - %a{href: main_app.admin_variant_overrides_path } inventory + %a{href: main_app.admin_inventory_path } inventory to restrict the list of products that are available to add to your shop in the Order Cycle interface. To enable this functionality, select 'Inventory Only' below. .row .alpha.eleven.columns diff --git a/app/views/admin/variant_overrides/_header.html.haml b/app/views/admin/variant_overrides/_header.html.haml index 7b4a38db47..e4a8e98420 100644 --- a/app/views/admin/variant_overrides/_header.html.haml +++ b/app/views/admin/variant_overrides/_header.html.haml @@ -1,4 +1,8 @@ +- content_for :html_title do + = t("admin.inventory.title") + - content_for :page_title do - Override Product Details + %h1.page-title= t("admin.inventory.title") + %a.with-tip{ 'data-powertip' => "#{t("admin.inventory.description")}" }=t('admin.whats_this') = render :partial => 'spree/admin/shared/product_sub_menu' diff --git a/config/locales/en.yml b/config/locales/en.yml index a72afe655d..7603457981 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -72,7 +72,11 @@ en: actions: Actions viewing: "Viewing: %{current_view_name}" + whats_this: What's this? + inventory: + title: Inventory + description: Use this page to manage inventories for your enterprises. Any product details set here will override those set on the 'Products' page sku: SKU price: Price on_hand: On Hand diff --git a/config/routes.rb b/config/routes.rb index 64dbc7c7f8..9821a8b4bf 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -104,6 +104,8 @@ Openfoodnetwork::Application.routes.draw do get :move_down end + get '/inventory', to: 'variant_overrides#index' + resources :variant_overrides do post :bulk_update, on: :collection post :bulk_reset, on: :collection diff --git a/spec/features/admin/variant_overrides_spec.rb b/spec/features/admin/variant_overrides_spec.rb index 392b5b48b3..6f10cd8405 100644 --- a/spec/features/admin/variant_overrides_spec.rb +++ b/spec/features/admin/variant_overrides_spec.rb @@ -22,7 +22,7 @@ feature %q{ describe "selecting a hub" do it "displays a list of hub choices" do - visit '/admin/variant_overrides' + visit '/admin/inventory' page.should have_select2 'hub_id', options: ['', hub.name, hub2.name] end @@ -51,7 +51,7 @@ feature %q{ context "when a hub is selected" do before do - visit '/admin/variant_overrides' + visit '/admin/inventory' select2_select hub.name, from: 'hub_id' end @@ -216,7 +216,7 @@ feature %q{ let!(:inventory_item3) { create(:inventory_item, enterprise: hub, variant: variant3) } before do - visit '/admin/variant_overrides' + visit '/admin/inventory' select2_select hub.name, from: 'hub_id' end @@ -305,7 +305,7 @@ feature %q{ context "when a hub is selected" do before do - visit '/admin/variant_overrides' + visit '/admin/inventory' select2_select hub.name, from: 'hub_id' end