Skip to content

Commit

Permalink
onboarding: implement demographic info step
Browse files Browse the repository at this point in the history
  • Loading branch information
algodave committed Feb 24, 2016
1 parent 7239a43 commit 688a6eb
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
5 changes: 4 additions & 1 deletion frontend/app/components/onboarding/demographic-step.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ import Ember from 'ember';
export default Ember.Component.extend({

model: Ember.computed.alias('parentView.model'),
profile: Ember.computed.alias('model.profile'),

actions: {
completeStep() {
this.get('onStepCompleted')();
this.get('profile').save().then( () => {
this.get('onStepCompleted')();
});
},

goBack() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,33 @@
<p>TODO: demographic info form</p>
{{#form-for for=profile}}

{{#form-field for="ethnicities"
label="Ethnic Origin"}}
{{select-field resource="ethnicity" async=false
multiple=true
selection=profile.ethnicities
placeholder="Select all that apply"}}
{{/form-field}}

{{#form-field for="dayHabit"
label="How you spend most of your day?"}}
{{select-field resource="dayHabit" async=false
selection=profile.dayHabit
placeholder="Select one option"}}
{{/form-field}}

{{#form-field for="educationLevel"
label="Highest level of education completed"}}
{{select-field resource="educationLevel" async=false
selection=profile.educationLevel
placeholder="Select one option"}}
{{/form-field}}

{{#form-field for="dayWalkingHours"
label="How many hours a day do you spend walking or exercising, on average?"}}
{{input type="number" value=profile.dayWalkingHours}}
{{/form-field}}

{{/form-for}}

{{step-controls step=model.currentStep
onBackward=(action "goBack")
Expand Down
2 changes: 0 additions & 2 deletions frontend/app/templates/components/profile-form.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
{{select-field resource="country" async=false
selection=model.country
placeholder="Select a country"}}


{{/form-field}}

{{#form-field for="birthDate" label="Birth Date"}}
Expand Down

0 comments on commit 688a6eb

Please sign in to comment.