mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Re-arranging product page into partials, redoing price display
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
%th.variant Variant
|
||||
%th QTY
|
||||
%th Bulk
|
||||
%th Price
|
||||
%th.text-right Price
|
||||
%tbody{"ng-repeat" => "product in data.products | filter:query"}
|
||||
%tr.product
|
||||
%td.name
|
||||
@@ -45,25 +45,10 @@
|
||||
min: 0,
|
||||
max: "{{product.on_demand && 9999 || product.count_on_hand }}",
|
||||
name: "variant_attributes[{{product.master.id}}][max_quantity]"}
|
||||
%td.price
|
||||
%td.price.text-right
|
||||
%small{"ng-show" => "(product.variants.length > 0)"} from
|
||||
${{ product.price }}
|
||||
{{ product.price | currency }}
|
||||
%tr{"ng-repeat" => "variant in product.variants", "ng-show" => "product.show_variants"}
|
||||
%td{colspan: 2}
|
||||
%td {{variant.options_text}}
|
||||
%td
|
||||
%input{type: :number,
|
||||
value: 0,
|
||||
min: 0,
|
||||
max: "{{variant.on_demand && 9999 || variant.count_on_hand }}",
|
||||
name: "variants[{{variant.id}}]", id: "variants_{{variant.id}}"}
|
||||
%td.group_buy
|
||||
%span{"ng-show" => "product.group_buy"}
|
||||
%input{type: :number,
|
||||
min: 0,
|
||||
max: "{{variant.on_demand && 9999 || variant.count_on_hand }}",
|
||||
name: "variant_attributes[{{variant.id}}][max_quantity]"}
|
||||
%td.price
|
||||
%small ${{variant.price }}
|
||||
= render partial: "shop/variant"
|
||||
%input.button.right{type: :submit, value: "Check Out"}
|
||||
-#%pre {{ data.products | json }}
|
||||
|
||||
17
app/views/shop/_variant.html.haml
Normal file
17
app/views/shop/_variant.html.haml
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
%td{colspan: 2}
|
||||
%td {{variant.options_text}}
|
||||
%td
|
||||
%input{type: :number,
|
||||
value: 0,
|
||||
min: 0,
|
||||
max: "{{variant.on_demand && 9999 || variant.count_on_hand }}",
|
||||
name: "variants[{{variant.id}}]", id: "variants_{{variant.id}}"}
|
||||
%td.group_buy
|
||||
%span{"ng-show" => "product.group_buy"}
|
||||
%input{type: :number,
|
||||
min: 0,
|
||||
max: "{{variant.on_demand && 9999 || variant.count_on_hand }}",
|
||||
name: "variant_attributes[{{variant.id}}][max_quantity]"}
|
||||
%td.price.text-right
|
||||
{{ variant.price | currency }}
|
||||
@@ -76,8 +76,7 @@ feature "As a consumer I want to shop with a distributor", js: true do
|
||||
|
||||
pending "shows the table after an order cycle is selected" do
|
||||
select "frogs", :from => "order_cycle_id"
|
||||
save_and_open_page
|
||||
#page.should have_selector("input.button.right", visible: true)
|
||||
page.should have_selector("input.button.right", visible: true)
|
||||
end
|
||||
|
||||
describe "with products in our order cycle" do
|
||||
|
||||
Reference in New Issue
Block a user