mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Display variants under products for exchange suppliers
This commit is contained in:
@@ -5,5 +5,9 @@ r.list_of :enterprises, @collection do
|
||||
r.list_of :supplied_products do |product|
|
||||
r.element :name
|
||||
r.element :image_url, product.images.present? ? product.images.first.attachment.url(:mini) : nil
|
||||
r.list_of :variants do |variant|
|
||||
r.element :id
|
||||
r.element :label, variant.options_text
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
.exchange-product{'ng-repeat' => 'product in enterprises[exchange.enterprise_id].supplied_products'}
|
||||
%img{'ng-src' => '{{ product.image_url }}'}
|
||||
{{ product.name }}
|
||||
.exchange-product-variant{'ng-repeat' => 'variant in product.variants'}
|
||||
{{ variant.label }}
|
||||
|
||||
= select_tag :new_supplier_id, options_from_collection_for_select(Enterprise.is_primary_producer, :id, :name), {'ng-model' => 'new_supplier_id'}
|
||||
= f.submit 'Add supplier', 'ng-click' => 'addSupplier($event)'
|
||||
|
||||
Reference in New Issue
Block a user