mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-07 07:36:58 +00:00
Do not show deleted products in order cycle admin
This commit is contained in:
10
app/views/admin/enterprises/_supplied_product.rabl
Normal file
10
app/views/admin/enterprises/_supplied_product.rabl
Normal file
@@ -0,0 +1,10 @@
|
||||
object @product
|
||||
|
||||
attributes :name
|
||||
node(:supplier_name) { |p| p.supplier.andand.name }
|
||||
node(:image_url) { |p| p.images.present? ? p.images.first.attachment.url(:mini) : nil }
|
||||
node(:master_id) { |p| p.master.id }
|
||||
child variants: :variants do |variant|
|
||||
attributes :id
|
||||
node(:label) { |v| v.options_text }
|
||||
end
|
||||
@@ -2,13 +2,8 @@ collection @collection
|
||||
|
||||
attributes :id, :name
|
||||
|
||||
child supplied_products: :supplied_products do |product|
|
||||
attributes :name
|
||||
node(:supplier_name) { |p| p.supplier.andand.name }
|
||||
node(:image_url) { |p| p.images.present? ? p.images.first.attachment.url(:mini) : nil }
|
||||
node(:master_id) { |p| p.master.id }
|
||||
child variants: :variants do |variant|
|
||||
attributes :id
|
||||
node(:label) { |v| v.options_text }
|
||||
node(:supplied_products) do |enterprise|
|
||||
enterprise.supplied_products.not_deleted.map do |product|
|
||||
partial 'admin/enterprises/supplied_product', object: product
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user