Display variants under products for exchange suppliers

This commit is contained in:
Rohan Mitchell
2013-01-08 13:33:02 +11:00
parent 043e67fd9d
commit 836f568b8e
2 changed files with 6 additions and 0 deletions

View File

@@ -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

View File

@@ -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)'