Sticks the level submission data into the contact form's message attribute

This commit is contained in:
Josh Callebaut 2016-01-27 13:55:17 -08:00
parent 8347c8247f
commit 42efe6264b

View file

@ -32,9 +32,13 @@ module.exports = class ArtisanGuideModal extends ModalView
levelSubmit: ->
@playSound 'menu-button-click'
forms.clearFormAlerts @$el
contactMessage = forms.formToObject @$el
res = tv4.validateMultiple contactMessage, contactSchema
results = forms.formToObject @$el
res = tv4.validateMultiple results, contactSchema
return forms.applyErrorsToForm @$el, res.errors unless res.valid
contactMessage = {message:"""Name: #{results.creditName}
Purpose: #{results.levelPurpose}
Inspiration: #{results.levelInspiration}
Location: #{results.levelLocation}"""}
@populateBrowserData contactMessage
contactMessage = _.merge contactMessage, @options
contactMessage.country = me.get('country')