Commit 9e9ffc96 authored by Matthew Taylor's avatar Matthew Taylor Committed by GitHub

Merge pull request #779 from mewtaylor/issue/gh-773

Fix GH-[772,773]: Fix “afterschool” typo, default country and margin for username
parents 9a050165 40fb433d
...@@ -27,6 +27,23 @@ var Tooltip = require('../../components/tooltip/tooltip.jsx'); ...@@ -27,6 +27,23 @@ var Tooltip = require('../../components/tooltip/tooltip.jsx');
require('./steps.scss'); require('./steps.scss');
var DEFAULT_COUNTRY = 'us'; var DEFAULT_COUNTRY = 'us';
var getCountryOptions = function (defaultCountry) {
var options = countryData.countryOptions.concat({
label: <intl.FormattedMessage id="teacherRegistration.selectCountry" />,
disabled: true,
selected: true
});
if (typeof defaultCountry !== 'undefined') {
return options.sort(function (a, b) {
if (a.disabled) return -1;
if (b.disabled) return 1;
if (a.value === defaultCountry) return -1;
if (b.value === defaultCountry) return 1;
return 0;
}.bind(this));
}
return options;
};
var NextStepButton = React.createClass({ var NextStepButton = React.createClass({
getDefaultProps: function () { getDefaultProps: function () {
...@@ -124,12 +141,14 @@ module.exports = { ...@@ -124,12 +141,14 @@ module.exports = {
<Card> <Card>
<Form onValidSubmit={this.onValidSubmit}> <Form onValidSubmit={this.onValidSubmit}>
<div> <div>
<b>{formatMessage({id: 'registration.createUsername'})}</b> <div className="username-label">
{this.props.usernameHelp ? ( <b>{formatMessage({id: 'registration.createUsername'})}</b>
<p className="help-text">{this.props.usernameHelp}</p> {this.props.usernameHelp ? (
):( <p className="help-text">{this.props.usernameHelp}</p>
null ):(
)} null
)}
</div>
<Input className={this.state.validUsername} <Input className={this.state.validUsername}
type="text" type="text"
name="user.username" name="user.username"
...@@ -251,7 +270,6 @@ module.exports = { ...@@ -251,7 +270,6 @@ module.exports = {
DemographicsStep: intl.injectIntl(React.createClass({ DemographicsStep: intl.injectIntl(React.createClass({
getDefaultProps: function () { getDefaultProps: function () {
return { return {
defaultCountry: DEFAULT_COUNTRY,
waiting: false, waiting: false,
description: null description: null
}; };
...@@ -265,7 +283,7 @@ module.exports = { ...@@ -265,7 +283,7 @@ module.exports = {
'August', 'September', 'October', 'November', 'December' 'August', 'September', 'October', 'November', 'December'
].map(function (label, id) { ].map(function (label, id) {
return { return {
value: id+1, value: id + 1,
label: this.props.intl.formatMessage({id: 'general.month' + label})}; label: this.props.intl.formatMessage({id: 'general.month' + label})};
}.bind(this)); }.bind(this));
}, },
...@@ -321,8 +339,7 @@ module.exports = { ...@@ -321,8 +339,7 @@ module.exports = {
</div> </div>
<Select label={formatMessage({id: 'general.country'})} <Select label={formatMessage({id: 'general.country'})}
name="user.country" name="user.country"
options={countryData.countryOptions} options={getCountryOptions(DEFAULT_COUNTRY)}
value={this.props.defaultCountry}
required /> required />
<Checkbox className="demographics-checkbox-is-robot" <Checkbox className="demographics-checkbox-is-robot"
label="I'm a robot!" label="I'm a robot!"
...@@ -573,17 +590,6 @@ module.exports = { ...@@ -573,17 +590,6 @@ module.exports = {
var formatMessage = this.props.intl.formatMessage; var formatMessage = this.props.intl.formatMessage;
var stateOptions = countryData.subdivisionOptions[this.state.countryChoice]; var stateOptions = countryData.subdivisionOptions[this.state.countryChoice];
stateOptions = [{}].concat(stateOptions); stateOptions = [{}].concat(stateOptions);
var countryOptions = countryData.countryOptions.concat({
label: formatMessage({id: 'teacherRegistration.selectCountry'}),
disabled: true,
selected: true
}).sort(function (a, b) {
if (a.disabled) return -1;
if (b.disabled) return 1;
if (a.value === this.props.defaultCountry) return -1;
if (b.value === this.props.defaultCountry) return 1;
return 0;
}.bind(this));
return ( return (
<Slide className="registration-step address-step"> <Slide className="registration-step address-step">
<h2> <h2>
...@@ -598,7 +604,8 @@ module.exports = { ...@@ -598,7 +604,8 @@ module.exports = {
<Form onValidSubmit={this.onValidSubmit}> <Form onValidSubmit={this.onValidSubmit}>
<Select label={formatMessage({id: 'general.country'})} <Select label={formatMessage({id: 'general.country'})}
name="address.country" name="address.country"
options={countryOptions} options={getCountryOptions()}
value={this.props.defaultCountry}
onChange={this.onChangeCountry} onChange={this.onChangeCountry}
required /> required />
<Input label={formatMessage({id: 'teacherRegistration.addressLine1'})} <Input label={formatMessage({id: 'teacherRegistration.addressLine1'})}
......
...@@ -50,6 +50,12 @@ ...@@ -50,6 +50,12 @@
} }
} }
&.username-step {
.username-label {
margin-bottom: .75rem;
}
}
&.demographics-step { &.demographics-step {
.gender-input { .gender-input {
margin-top: -5.5rem; margin-top: -5.5rem;
...@@ -80,7 +86,7 @@ ...@@ -80,7 +86,7 @@
&.organization-step { &.organization-step {
.checkbox-group { .checkbox-group {
.validation-message { .validation-message {
transform: translate(16rem, -16rem); transform: translate(16rem, 8rem);
} }
} }
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
"teacherRegistration.orgChoiceMiddleSchool": "Middle School", "teacherRegistration.orgChoiceMiddleSchool": "Middle School",
"teacherRegistration.orgChoiceHighSchool": "High School", "teacherRegistration.orgChoiceHighSchool": "High School",
"teacherRegistration.orgChoiceUniversity": "College/University", "teacherRegistration.orgChoiceUniversity": "College/University",
"teacherRegistration.orgChoiceAfterschool": "Afterscool Program", "teacherRegistration.orgChoiceAfterschool": "Afterschool Program",
"teacherRegistration.orgChoiceMuseum": "Museum", "teacherRegistration.orgChoiceMuseum": "Museum",
"teacherRegistration.orgChoiceLibrary": "Library", "teacherRegistration.orgChoiceLibrary": "Library",
"teacherRegistration.orgChoiceCamp": "Camp", "teacherRegistration.orgChoiceCamp": "Camp",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment