Re-arranging product page into partials, redoing price display

This commit is contained in:
Will Marshall
2014-02-04 11:24:27 +11:00
parent 9373dcea3d
commit 934f1eb196
3 changed files with 22 additions and 21 deletions

View File

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

View 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 }}

View File

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