Merge branch 'master' into production

This commit is contained in:
Matt Lott 2015-06-05 15:12:36 -07:00
commit 251fcf05fd
6 changed files with 69 additions and 43 deletions

View file

@ -642,6 +642,33 @@
sys_requirements_1: "A modern web browser. Newer versions of Chrome, Firefox, or Safari. Internet Explorer 9 or later."
sys_requirements_2: "CodeCombat is not supported on iPad yet."
teachers_survey:
title: "Teacher Survey"
must_be_logged: "You must be logged in to apply. Please create an account or log in from the menu above."
retrieving: "Retrieving information..."
being_reviewed_1: "Your application for a free trial subscription is being"
being_reviewed_2: "reviewed"
approved_1: "Your application for a free trial subscription was"
approved_2: "approved."
approved_3: "Further instructions have been sent to"
denied_1: "Your application for a free trial subscription has been"
denied_2: "denied"
contact_1: "Please contact"
contact_2: "if you have further questions."
description_1: "We offer free subscriptions to teachers for evaluation purposes. You can find more information on our"
description_2: "teachers"
description_3: "page."
description_4: "Please fill out this quick survey and well email you setup instructions."
email: "Email Address"
school_city: "Name of School, City"
age_students: "How old are your students?"
under: "Under"
other: "Other:"
amount_students: "How many students do you teach?"
hear_about: "How did you hear about CodeCombat?"
fill_fields: "Please fill out all fields."
thanks: "Thanks! We'll send you setup instructions shortly."
versions:
save_version_title: "Save New Version"
new_major_version: "New Major Version"

View file

@ -2,51 +2,51 @@ extends /templates/base
block content
h2 Teacher Survey
h2(data-i18n="teachers_survey.title") Teacher Survey
if me.isAnonymous()
p You must be logged in to apply. Please create an account or log in from the menu above.
p(data-i18n="teachers_survey.must_be_logged") You must be logged in to apply. Please create an account or log in from the menu above.
else if fetchingData
h4 Retrieving information...
h4(data-i18n="teachers_survey.retrieving") Retrieving information...
else if existingRequests.length > 0
if existingRequests[0].get('status') === 'submitted'
p
span.spr Your application for a free trial subscription is being
strong reviewed
span.spr(data-i18n="teachers_survey.being_reviewed_1") Your application for a free trial subscription is being
strong(data-i18n="teachers_survey.being_reviewed_2") reviewed
else if existingRequests[0].get('status') === 'approved'
p
span.spr Your application for a free trial subscription was
strong.spr approved
span.spr . Further instructions have been sent to
span.spr(data-i18n="teachers_survey.approved_1") Your application for a free trial subscription was
strong.spr(data-i18n="teachers_survey.approved_2") approved.
span.spr(data-i18n="teachers_survey.approved_3") Further instructions have been sent to
strong= existingRequests[0].get('properties').email
else
p
span.spr Your application for a free trial subscription has been
strong.spr denied
span.spr(data-i18n="teachers_survey.denied_1") Your application for a free trial subscription has been
strong(data-i18n="teachers_survey.denied_2") denied
p
span.spr Please contact
span.spr
a(href='mailto:team@codecombat.com') team@codecombat.com
span if you have further questions.
span.spr(data-i18n="teachers_survey.contact_1") Please contact
a(href='mailto:team@codecombat.com') team@codecombat.com
span.spl(data-i18n="teachers_survey.contact_2") if you have further questions.
else
p
span.spr We offer free subscriptions to teachers for evaluation purposes. You can find more information on our
a.spr(href='/teachers') teachers
span page.
p Please fill out this quick survey and well email you setup instructions.
span.spr(data-i18n="teachers_survey.description_1") We offer free subscriptions to teachers for evaluation purposes. You can find more information on our
a(href='/teachers', data-i18n="teachers_survey.description_2") teachers
span.spl(data-i18n="teachers_survey.description_3") page.
p(data-i18n="teachers_survey.description_4") Please fill out this quick survey and well email you setup instructions.
p.container-email-address
label.control-label Email Address
label.control-label(data-i18n="teachers_survey.email") Email Address
br
input.control-label.input-email-address(type='text', value=email)
p.container-location
label.control-label Name of School, City
label.control-label(data-i18n="teachers_survey.school_city") Name of School, City
br
input.control-label.input-location(type='text')
p.container-age
label.control-label How old are your students?
label.control-label(data-i18n="teachers_survey.age_students") How old are your students?
div
input(type="radio", name="age", value="Under 14")
span.spl Under 14
span.spl(data-i18n="teachers_survey.under") Under
span.spl 14
div
input(type="radio", name="age", value="14-17")
span.spl 14-17
@ -55,17 +55,17 @@ block content
span.spl 18+
div
input(type="radio", name="age", value='other')
span.spl.spr Other:
span.spl.spr(data-i18n="teachers_survey.other") Other:
input.spr.input-age-other(type='text')
p.container-num-students
label.control-label How many students do you teach?
label.control-label(data-i18n="teachers_survey.amount_students") How many students do you teach?
br
input.control-label.input-num-students(type='text')
p.container-heard-about
label.control-label How did you hear about CodeCombat?
label.control-label(data-i18n="teachers_survey.hear_about") How did you hear about CodeCombat?
br
textarea.control-label.input-heard-about(rows=4)
p.error-message Please fill out all fields.
p.error-message(data-i18n="teachers_survey.fill_fields") Please fill out all fields.
p
button.btn.btn-default.submit-button Submit
p.thanks-submit Thanks! We'll send you setup instructions shortly.
button.btn.btn-default.submit-button(data-i18n="play_level.tome_submit_button") Submit
p.thanks-submit(data-i18n="teachers_survey.thanks") Thanks! We'll send you setup instructions shortly.

View file

@ -20,8 +20,8 @@ block content
h3.teachers-title(data-i18n="teachers.teacher_subs_title")
p
span.spr(data-i18n="teachers.teacher_subs_1")
a.spr(href='/teachers/freetrial', data-i18n="teachers.teacher_subs_2")
span.spr(data-i18n="teachers.teacher_subs_3")
a(href='/teachers/freetrial', data-i18n="teachers.teacher_subs_2")
span.spl(data-i18n="teachers.teacher_subs_3")
h3(data-i18n="teachers.sub_includes_title")
p(data-i18n="teachers.sub_includes_1")
@ -47,11 +47,11 @@ block content
a(href='/clans', data-i18n="clans.clans")
span.spl(data-i18n="teachers.monitor_progress_4")
p(data-i18n="teachers.monitor_progress_5")
h4(data-i18n="teachers.sub_includes_7") Private Clans
h4(data-i18n="teachers.sub_includes_7")
p(data-i18n="teachers.private_clans_1")
p
span.spr(data-i18n="teachers.private_clans_2")
a(href='/clans', data-i18n="clans.clan") Clan
a(href='/clans', data-i18n="clans.clan")
span(data-i18n="teachers.private_clans_3")
h3(data-i18n="teachers.material_title")
@ -134,10 +134,9 @@ block content
h3(data-i18n="teachers.more_info_title")
p
span(data-i18n="teachers.more_info_1")
span.spr.spl
a(href='http://discourse.codecombat.com/c/teachers', data-i18n="teachers.more_info_2")
span.spr.spl(data-i18n="teachers.more_info_3")
span.spr(data-i18n="teachers.more_info_1")
a(href='http://discourse.codecombat.com/c/teachers', data-i18n="teachers.more_info_2")
span.spl(data-i18n="teachers.more_info_3")
h3(data-i18n="teachers.sys_requirements_title")
p(data-i18n="teachers.sys_requirements_1")

View file

@ -47,8 +47,7 @@ module.exports = class TeachersFreeTrialView extends RootView
$('.container-num-students').removeClass('has-error')
$('.container-heard-about').removeClass('has-error')
$('.error-message').hide()
emailPattern = /^([\w.-]+)@([\w.-]+)\.([a-zA-Z.]{2,6})$/i
unless email?.match(emailPattern)
unless email
$('.container-email-address').addClass('has-error')
$('.error-message').show()
return

View file

@ -266,6 +266,7 @@ PaymentHandler = class PaymentHandler extends Handler
description: req.body.description
}
receipt_email: req.user.get('email')
statement_descriptor: 'CODECOMBAT.COM'
}).then(
# success case
((charge) => @recordStripeCharge(req, res, charge)),

View file

@ -29,7 +29,7 @@ TrialRequestSchema.pre 'save', (next) ->
TrialRequestSchema.post 'save', (doc) ->
if doc.get('status') is 'submitted'
msg = "http://codecombat.com/admin/trial-requests #{doc.get('type')} request submitted by #{doc.get('properties').email}"
msg = "<a href=\"http://codecombat.com/admin/trial-requests\">Trial Request</a> submitted by #{doc.get('properties').email}"
hipchat.sendHipChatMessage msg, ['tower']
else if doc.get('status') is 'approved'
ppc = doc.get('prepaidCode')