mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-27 06:23:41 -04:00
Add schoolName field to AuthModal
This commit is contained in:
parent
38a4ca4ec0
commit
88ee363576
7 changed files with 34 additions and 12 deletions
app
core
locale
schemas/models
styles/modal
templates/core
views/core
server/users
|
@ -6,6 +6,7 @@ module.exports.formToObject = (el) ->
|
|||
input = $(input)
|
||||
continue unless name = input.attr('name')
|
||||
obj[name] = input.val()
|
||||
obj[name] = obj[name].trim() if obj[name]?.trim
|
||||
|
||||
obj
|
||||
|
||||
|
|
|
@ -119,6 +119,9 @@
|
|||
social_signup: "Or, you can sign up through Facebook or G+:"
|
||||
required: "You need to log in before you can go that way."
|
||||
login_switch: "Already have an account?"
|
||||
school_name: "School Name and City"
|
||||
optional: "optional"
|
||||
school_name_placeholder: "Example High School, Springfield, IL"
|
||||
|
||||
recover:
|
||||
recover_account_title: "Recover Account"
|
||||
|
|
|
@ -324,6 +324,7 @@ _.extend UserSchema.properties,
|
|||
coursePrepaidID: c.objectId({
|
||||
description: 'Prepaid which has paid for this user\'s course access'
|
||||
})
|
||||
schoolName: {type: 'string'}
|
||||
|
||||
c.extendBasicProperties UserSchema, 'user'
|
||||
|
||||
|
|
|
@ -95,6 +95,9 @@
|
|||
font-family: $headings-font-family
|
||||
margin-bottom: 0
|
||||
|
||||
.optional-note
|
||||
font-size: 14px
|
||||
|
||||
//- Check boxes
|
||||
|
||||
.form-group.checkbox
|
||||
|
|
|
@ -42,15 +42,27 @@
|
|||
input#password.input-large.form-control(name="password", type="password", value=formValues.password)
|
||||
|
||||
if mode === 'signup'
|
||||
.form-group
|
||||
label.control-label(for="name")
|
||||
span(data-i18n="general.name") Name
|
||||
| :
|
||||
.input-border
|
||||
if me.get('name')
|
||||
input#name.input-large.form-control(name="name", type="text", value="#{me.get('name')}")
|
||||
else
|
||||
input#name.input-large.form-control(name="name", type="text", value="", placeholder="Anoner")
|
||||
.row
|
||||
.col-md-6
|
||||
.form-group
|
||||
label.control-label(for="name")
|
||||
span(data-i18n="general.name") Name
|
||||
| :
|
||||
.input-border
|
||||
if me.get('name')
|
||||
input#name.input-large.form-control(name="name", type="text", value="#{me.get('name')}")
|
||||
else
|
||||
input#name.input-large.form-control(name="name", type="text", value="", placeholder="e.g. Alex W the Skater")
|
||||
.col-md-6
|
||||
.form-group
|
||||
label.control-label(for="school-input")
|
||||
span.spr(data-i18n="signup.school_name") School Name and City
|
||||
em.optional-note
|
||||
| (
|
||||
span(data-i18n="signup.optional") optional
|
||||
| ):
|
||||
.input-border
|
||||
input#school-input.input-large.form-control(name="schoolName", data-i18n="[placeholder]signup.school_name_placeholder")
|
||||
.form-group.checkbox
|
||||
label.control-label(for="subscribe")
|
||||
.input-border
|
||||
|
|
|
@ -92,7 +92,7 @@ module.exports = class AuthModal extends ModalView
|
|||
delete userObject.subscribe
|
||||
delete userObject.name if userObject.name is ''
|
||||
userObject.name = @suggestedName if @suggestedName
|
||||
for key, val of me.attributes when key in ['preferredLanguage', 'testGroupNumber', 'dateCreated', 'wizardColor1', 'name', 'music', 'volume', 'emails']
|
||||
for key, val of me.attributes when key in ['preferredLanguage', 'testGroupNumber', 'dateCreated', 'wizardColor1', 'name', 'music', 'volume', 'emails', 'schoolName']
|
||||
userObject[key] ?= val
|
||||
subscribe = @$el.find('#subscribe').prop('checked')
|
||||
userObject.emails ?= {}
|
||||
|
|
|
@ -30,6 +30,7 @@ UserSchema.index({'simulatedBy': 1})
|
|||
UserSchema.index({'slug': 1}, {name: 'slug index', sparse: true, unique: true})
|
||||
UserSchema.index({'stripe.subscriptionID': 1}, {unique: true, sparse: true})
|
||||
UserSchema.index({'siteref': 1}, {name: 'siteref index', sparse: true})
|
||||
#UserSchema.index({'schoolName': 1}, {name: 'schoolName index', sparse: true}) # Will we need this?
|
||||
|
||||
UserSchema.post('init', ->
|
||||
@set('anonymous', false) if @get('email')
|
||||
|
@ -311,7 +312,8 @@ UserSchema.statics.hashPassword = (password) ->
|
|||
UserSchema.statics.privateProperties = [
|
||||
'permissions', 'email', 'mailChimp', 'firstName', 'lastName', 'gender', 'facebookID',
|
||||
'gplusID', 'music', 'volume', 'aceConfig', 'employerAt', 'signedEmployerAgreement',
|
||||
'emailSubscriptions', 'emails', 'activity', 'stripe', 'stripeCustomerID', 'chinaVersion', 'country'
|
||||
'emailSubscriptions', 'emails', 'activity', 'stripe', 'stripeCustomerID', 'chinaVersion', 'country',
|
||||
'schoolName', 'ageRange'
|
||||
]
|
||||
UserSchema.statics.jsonSchema = jsonschema
|
||||
UserSchema.statics.editableProperties = [
|
||||
|
@ -319,7 +321,7 @@ UserSchema.statics.editableProperties = [
|
|||
'firstName', 'lastName', 'gender', 'ageRange', 'facebookID', 'gplusID', 'emails',
|
||||
'testGroupNumber', 'music', 'hourOfCode', 'hourOfCodeComplete', 'preferredLanguage',
|
||||
'wizard', 'aceConfig', 'autocastDelay', 'lastLevel', 'jobProfile', 'savedEmployerFilterAlerts',
|
||||
'heroConfig', 'iosIdentifierForVendor', 'siteref', 'referrer'
|
||||
'heroConfig', 'iosIdentifierForVendor', 'siteref', 'referrer', 'schoolName'
|
||||
]
|
||||
|
||||
UserSchema.plugin plugins.NamedPlugin
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue