Merge branch 'production'

This commit is contained in:
Scott Erickson 2014-01-08 14:59:49 -08:00
commit 50beeb93bc
3 changed files with 22 additions and 12 deletions

View file

@ -42,16 +42,20 @@ module.exports = FacebookHandler = class FacebookHandler extends CocoClass
return
oldEmail = me.get('email')
me.set('firstName', r.first_name) if r.first_name
me.set('lastName', r.last_name) if r.last_name
me.set('gender', r.gender) if r.gender
me.set('email', r.email) if r.email
me.set('facebookID', r.id) if r.id
patch = {}
patch.firstName = r.first_name if r.first_name
patch.lastName = r.last_name if r.last_name
patch.gender = r.gender if r.gender
patch.email = r.email if r.email
patch.facebookID = r.id if r.id
me.set(patch)
patch._id = me.id
Backbone.Mediator.publish('logging-in-with-facebook')
window.tracker?.trackEvent 'Facebook Login'
window.tracker?.identify()
me.save({}, {
me.save(patch, {
patch: true
error: backboneFailure,
url: "/db/user?facebookID=#{r.id}&facebookAccessToken=#{@authResponse.accessToken}"
success: (model) ->

View file

@ -64,7 +64,12 @@ module.exports = GPlusHandler = class GPlusHandler extends CocoClass
gplusID = me.get('gplusID')
window.tracker?.trackEvent 'Google Login'
window.tracker?.identify()
me.save({}, {
patch = {}
patch[key] = me.get(key) for gplusKey, key of userPropsToSave
patch._id = me.id
patch.email = me.get('email')
me.save(patch, {
patch: true
error: backboneFailure,
url: "/db/user?gplusID=#{gplusID}&gplusAccessToken=#{@accessToken}"
success: (model) ->

View file

@ -9,15 +9,16 @@ body
select.language-dropdown
if me.get('anonymous')
button.btn.btn-primary.navbuttontext(data-toggle="coco-modal", data-target="modal/signup", data-i18n="nav.sign_up") Create Account
button.btn.btn-primary.navbuttontext(data-toggle="coco-modal", data-target="modal/login", data-i18n="nav.log_in") Log In
else
button.btn.btn-primary.navbuttontext#logout-button(data-i18n="nav.log_out") Logout
if me.get('anonymous') === false
button.btn.btn-primary.navbuttontext#logout-button(data-i18n="nav.log_out") Log Out
a.btn.btn-primary.navbuttontext(href="/account/profile/#{me.id}")
| #{me.displayName()}
i.icon-cog.icon-white.big
else
button.btn.btn-primary.navbuttontext(data-toggle="coco-modal", data-target="modal/signup", data-i18n="nav.sign_up") Create Account
button.btn.btn-primary.navbuttontext(data-toggle="coco-modal", data-target="modal/login", data-i18n="nav.log_in") Log In
ul(class='navbar-link-text').nav.pull-right
li.play
a(href='/play', data-i18n="nav.play") Levels