diff --git a/app/views/shop/_products.html.haml b/app/views/shop/_products.html.haml index d332057931..1840a3ad98 100644 --- a/app/views/shop/_products.html.haml +++ b/app/views/shop/_products.html.haml @@ -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 }} diff --git a/app/views/shop/_variant.html.haml b/app/views/shop/_variant.html.haml new file mode 100644 index 0000000000..0adb5a2421 --- /dev/null +++ b/app/views/shop/_variant.html.haml @@ -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 }} diff --git a/spec/features/consumer/shopping_spec.rb b/spec/features/consumer/shopping_spec.rb index a840e2f92b..7a73801169 100644 --- a/spec/features/consumer/shopping_spec.rb +++ b/spec/features/consumer/shopping_spec.rb @@ -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