mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
Move import to new action
Making way for a review step.
This commit is contained in:
@@ -10,7 +10,7 @@ module Admin
|
||||
self.class
|
||||
end
|
||||
|
||||
def index
|
||||
def import
|
||||
# The plan:
|
||||
#
|
||||
# * Fetch DFC catalog as JSON from URL.
|
||||
|
||||
7
app/views/admin/dfc_product_imports/import.html.haml
Normal file
7
app/views/admin/dfc_product_imports/import.html.haml
Normal file
@@ -0,0 +1,7 @@
|
||||
- content_for :page_title do
|
||||
#{t(".title")}
|
||||
|
||||
= render partial: 'spree/admin/shared/product_sub_menu'
|
||||
|
||||
%p= t(".imported_products")
|
||||
= @count
|
||||
@@ -3,5 +3,4 @@
|
||||
|
||||
= render partial: 'spree/admin/shared/product_sub_menu'
|
||||
|
||||
%p= t(".imported_products")
|
||||
= @count
|
||||
watch this space
|
||||
|
||||
@@ -846,7 +846,7 @@ en:
|
||||
map: Map
|
||||
|
||||
dfc_product_imports:
|
||||
index:
|
||||
import:
|
||||
title: "Importing a DFC product catalog"
|
||||
imported_products: "Imported products:"
|
||||
enterprise_fees:
|
||||
|
||||
@@ -69,7 +69,9 @@ Openfoodnetwork::Application.routes.draw do
|
||||
post '/product_import/save_data', to: 'product_import#save_data', as: 'product_import_save_async'
|
||||
post '/product_import/reset_absent', to: 'product_import#reset_absent_products', as: 'product_import_reset_async'
|
||||
|
||||
resources :dfc_product_imports, only: [:index]
|
||||
resources :dfc_product_imports, only: [:index] do
|
||||
post :import, on: :collection
|
||||
end
|
||||
|
||||
constraints FeatureToggleConstraint.new(:admin_style_v3) do
|
||||
# This might be easier to arrange once we rename the controller to plain old "products"
|
||||
|
||||
Reference in New Issue
Block a user