Adding countries and states to registration

This commit is contained in:
Rob H
2014-08-21 14:06:41 +10:00
parent 7dc42c9e39
commit ef8f611458
10 changed files with 56 additions and 45 deletions

View File

@@ -1 +1 @@
YAY! You created an enterprise!
Yay! You created an enterprise!

View File

@@ -19,15 +19,10 @@
.row
.small-12.large-8.columns
%label{ for: 'enterprise_country' } Country:
-#= select :country_id, available_countries.map{|c|[c.name, c.id]}, {include_blank: false}
%input.chunky.small-12.columns{ id: 'enterprise_country', placeholder: "eg. Australia" }
-# , ng: { model: 'enterprise.country' } }
%select.chunky.small-12.columns{ id: 'enterprise_country', ng: { model: 'enterprise.country', options: 'c as c.name for c in countries' } }
.small-12.large-4.columns
%label{ for: 'enterprise_state' } State:
- binding.pry
-#= select :state_id, available_countries.first.states.map{|c|[c.name, c.id]}
%input.chunky.small-12.columns{ id: 'enterprise_state', placeholder: "eg. Victoria" }
-# , ng: { model: 'enterprise.state' } }
%select.chunky.small-12.columns{ id: 'enterprise_state', ng: { model: 'enterprise.address.state_id', options: 's.id as s.abbr for s in enterprise.country.states', show: 'countryHasStates()' } }
.small-5.columns
%h6
Location display

View File

@@ -34,4 +34,4 @@
.row
.small-12.columns
%input.button.primary{ type: "button", value: "Back", ng: { click: "select('address')" }, style: 'float:left' }
%input.button.primary{ type: "button", value: "Continue", ng: { click: "createEnterprise()" }, style: 'float:right' }
%input.button.primary{ type: "button", value: "Continue", ng: { click: "create()" }, style: 'float:right' }