Adding missing data-bindings for country/state

This commit is contained in:
Rob H
2014-08-28 10:03:53 +10:00
parent 7b89e6aa80
commit bfd9ffd84a
4 changed files with 17 additions and 16 deletions

View File

@@ -47,7 +47,7 @@
.small-6.columns.right
= ba.select :country_id, available_countries.map{|c|[c.name, c.id]},
{include_blank: false}, "ng-model" => "order.bill_address.country_id"
"ng-model" => "order.bill_address.country_id", required: true
.row
.small-12.columns.text-right

View File

@@ -9,23 +9,23 @@
%i.ofn-i_051-check-big
Your details
%accordion-group{"is-open" => "accordion.details",
%accordion-group{"is-open" => "accordion.details",
"ng-class" => "{valid: details.$valid, open: accordion.details}"}
%accordion-heading
.row
.small-8.medium-10.columns
%em
%em
%small
{{ summary() | printArray }}
.small-4.medium-2.columns.text-right
%span.accordion-up
%em
%em
%small Hide
%i.ofn-i_053-point-up
%i.ofn-i_053-point-up
%span.accordion-down
%em
%em
%small Expand
%i.ofn-i_052-point-down
%i.ofn-i_052-point-down
.row
.small-6.columns
@@ -36,10 +36,10 @@
.row
.small-6.columns
= validated_input 'Email', 'order.email', type: :email, "ofn-focus" => "accordion['details']"
.small-6.columns
= validated_input 'Phone', 'order.bill_address.phone'
.row
.small-12.columns.text-right
%button.primary{"ng-disabled" => "details.$invalid", "ng-click" => "next($event)"} Next

View File

@@ -14,16 +14,16 @@
%accordion-heading
.row
.small-8.medium-10.columns
%em
%em
%small
{{ Checkout.shippingMethod().name }}
.small-4.medium-2.columns.text-right
%span.accordion-up
%em
%em
%small Hide
%i.ofn-i_053-point-up
%i.ofn-i_053-point-up
%span.accordion-down
%em
%em
%small Expand
%i.ofn-i_052-point-down
@@ -61,13 +61,14 @@
.small-6.columns
= validated_input "City", "order.ship_address.city"
.small-6.columns
= sa.select :state_id, @order.shipping_address.country.states.map{|c|[c.name, c.id]}
= sa.select :state_id, @order.shipping_address.country.states.map{|c|[c.name, c.id]}, {include_blank: false},
"ng-model" => "order.ship_address.state_id", required: true
.row
.small-6.columns
= validated_input "Postcode", "order.ship_address.zipcode"
.small-6.columns.right
= sa.select :country_id, available_countries.map{|c|[c.name, c.id]},
{include_blank: false}
"ng-model" => "order.ship_address.country_id", required: true
.row
.small-6.columns
= validated_input "First Name", "order.ship_address.firstname"

View File

@@ -23,7 +23,7 @@ feature "As a consumer I want to check out my cart", js: true do
end
it "shows the current distributor on checkout" do
visit checkout_path
visit checkout_path
page.should have_content distributor.name
end