mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Display all supplied products for selection
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
r.list_of :enterprises, @collection do
|
||||
r.element :id
|
||||
r.element :name
|
||||
|
||||
r.list_of :supplied_products do |product|
|
||||
r.element :name
|
||||
r.element :image_url, product.images.present? ? product.images.first.attachment.url(:mini) : nil
|
||||
end
|
||||
end
|
||||
|
||||
@@ -25,7 +25,8 @@
|
||||
%td= f.submit 'Products', 'ng-click' => 'toggleProducts($event, exchange)'
|
||||
%tr.products{'ng-show' => 'exchange.showProducts'}
|
||||
%td{:colspan => 3}
|
||||
.exchange-product{'ng-repeat' => 'product in exchange.exchange_products'}
|
||||
.exchange-product{'ng-repeat' => 'product in enterprises[exchange.enterprise_id].supplied_products'}
|
||||
%img{'ng-src' => '{{ product.image_url }}'}
|
||||
{{ product.name }}
|
||||
|
||||
= select_tag :new_supplier_id, options_from_collection_for_select(Enterprise.is_primary_producer, :id, :name), {'ng-model' => 'new_supplier_id'}
|
||||
|
||||
@@ -10,6 +10,7 @@ r.element :order_cycle, @order_cycle do
|
||||
r.list_of :exchange_products do |product, exchange_variants|
|
||||
r.element :id, product.id
|
||||
r.element :name, product.name
|
||||
r.element :image_url, product.images.first.attachment.url(:mini)
|
||||
r.list_of :variants, exchange_variants.map { |ev| VariantPresenter.new(ev.variant) } do
|
||||
r.element :id
|
||||
r.element :image_url
|
||||
|
||||
Reference in New Issue
Block a user