Merge branch 'master' into production

This commit is contained in:
Nick Winter 2015-04-08 21:48:49 -07:00
commit 5a163d285a
2 changed files with 4 additions and 6 deletions

View file

@ -151,7 +151,7 @@ module.exports = class CampaignView extends RootView
@$el.find('#campaign-status').delay(4000).animate({top: "-=58"}, 1000) unless @terrain is 'dungeon'
if @terrain and me.get('anonymous') and me.get('lastLevel') is 'shadow-guard' and me.level() < 4
@openModalView new AuthModal supermodel: @supermodel, showSignupRationale: true, mode: 'signup'
else if @terrain and me.get('name') and me.get('lastLevel') in ['forgetful-gemsmith', 'signs-and-portents'] and me.level() < 5 and not (me.get('ageRange') in ['18-24', '25-34', '35-44', '45-100']) and not storage.load('sent-parent-email')
else if @terrain and me.get('name') and me.get('lastLevel') in ['forgetful-gemsmith', 'signs-and-portents'] and me.level() < 5 and not (me.get('ageRange') in ['18-24', '25-34', '35-44', '45-100']) and not storage.load('sent-parent-email') and not me.isPremium()
@openModalView new ShareProgressModal()
setCampaign: (@campaign) ->

View file

@ -361,7 +361,7 @@ UserHandler = class UserHandler extends Handler
# log.warn "sendOneTimeEmail #{type} #{email}"
unless type in ['subscribe modal parent', 'share progress modal parent', 'share progress modal friend']
unless type in ['subscribe modal parent', 'share progress modal parent']
return @sendBadInputError res, "Unknown one-time email type #{type}"
sendMail = (emailParams) =>
@ -382,6 +382,7 @@ UserHandler = class UserHandler extends Handler
name: req.user.get('name') or ''
if codeLanguage = req.user.get('aceConfig.language')
codeLanguage = codeLanguage[0].toUpperCase() + codeLanguage.slice(1)
codeLanguage = codeLanguage.replace 'script', 'Script'
emailParams['email_data']['codeLanguage'] = codeLanguage
if senderEmail = req.user.get('email')
emailParams['email_data']['senderEmail'] = senderEmail
@ -389,11 +390,8 @@ UserHandler = class UserHandler extends Handler
# Type-specific email data
if type is 'subscribe modal parent'
emailParams['email_id'] = sendwithus.templates.parent_subscribe_email
else if type in ['share progress modal parent', 'share progress modal friend']
else if type is 'share progress modal parent'
emailParams['email_id'] = sendwithus.templates.share_progress_email
emailParams['email_data']['premium'] = req.user.isPremium()
emailParams['email_data']['parent'] = type is 'share progress modal parent'
emailParams['email_data']['friend'] = type is 'share progress modal friend'
sendMail emailParams