mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 05:53:39 -04:00
Remove TeachersFreeTrialView
This commit is contained in:
parent
ba63dcde2c
commit
5fffb2eefb
5 changed files with 1 additions and 222 deletions
app
locale
styles
templates
views
|
@ -591,37 +591,6 @@
|
|||
more_info_1: "Our"
|
||||
more_info_2: "teachers forum"
|
||||
more_info_3: "is a good place to connect with fellow educators who are using CodeCombat."
|
||||
|
||||
teachers_survey:
|
||||
title: "Teacher Survey"
|
||||
must_be_logged: "You must be logged in first. Please create an account or log in from the menu above."
|
||||
retrieving: "Retrieving information..."
|
||||
being_reviewed_1: "Your application for a free trial is being"
|
||||
being_reviewed_2: "reviewed."
|
||||
approved_1: "Your application for a free trial was"
|
||||
approved_2: "approved!"
|
||||
approved_4: "You can now enroll your students on the"
|
||||
approved_5: "courses"
|
||||
approved_6: "page."
|
||||
denied_1: "Your application for a free trial has been"
|
||||
denied_2: "denied."
|
||||
contact_1: "Please contact"
|
||||
contact_2: "if you have further questions."
|
||||
description_1: "We offer free trials to teachers. You will be given 2 free enrollments which can be used to enroll students in paid courses."
|
||||
description_1b: "You can find more information on our"
|
||||
description_2: "teachers"
|
||||
description_3: "page."
|
||||
description_4: "Please fill out this quick survey and we’ll email you setup instructions."
|
||||
email: "Email Address"
|
||||
school: "Name of School"
|
||||
location: "Name of 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."
|
||||
|
||||
teachers_quote:
|
||||
name: "Quote Form"
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
#teachers-free-trial-view
|
||||
|
||||
.input-school
|
||||
width: 40%
|
||||
|
||||
.input-location
|
||||
width: 40%
|
||||
|
||||
.input-heard-about
|
||||
width: 100%
|
||||
|
||||
.logged-out-blurb
|
||||
font-size: 18px
|
||||
|
||||
.thanks-submit
|
||||
display: none
|
||||
|
||||
.email-address
|
||||
margin-right: 12px
|
||||
|
||||
.error-message
|
||||
display: none
|
||||
color: red
|
|
@ -89,5 +89,5 @@ block content
|
|||
mixin trial-and-questions
|
||||
h3(data-i18n="courses.questions")
|
||||
p
|
||||
span.spr(data-i18n="teachers_survey.contact_1")
|
||||
span.spr Please contact
|
||||
a(href='mailto:team@codecombat.com') team@codecombat.com
|
||||
|
|
|
@ -1,79 +0,0 @@
|
|||
extends /templates/base
|
||||
|
||||
block content
|
||||
|
||||
h2(data-i18n="teachers_survey.title")
|
||||
|
||||
- var existingRequest = view.existingRequests.at(0)
|
||||
if me.isAnonymous()
|
||||
p.logged-out-blurb(data-i18n="teachers_survey.must_be_logged")
|
||||
else if view.fetchingData
|
||||
h4(data-i18n="teachers_survey.retrieving")
|
||||
else if existingRequest
|
||||
if existingRequest.get('status') === 'submitted'
|
||||
p
|
||||
span.spr(data-i18n="teachers_survey.being_reviewed_1")
|
||||
strong(data-i18n="teachers_survey.being_reviewed_2")
|
||||
else if existingRequest.get('status') === 'approved'
|
||||
p
|
||||
span.spr(data-i18n="teachers_survey.approved_1")
|
||||
strong.spr(data-i18n="teachers_survey.approved_2")
|
||||
span.spr(data-i18n="teachers_survey.approved_4")
|
||||
a(href='/courses/teachers', data-i18n="teachers_survey.approved_5")
|
||||
span.spl(data-i18n="teachers_survey.approved_6")
|
||||
else
|
||||
p
|
||||
span.spr(data-i18n="teachers_survey.denied_1")
|
||||
strong(data-i18n="teachers_survey.denied_2")
|
||||
p
|
||||
span.spr(data-i18n="teachers_survey.contact_1")
|
||||
a(href='mailto:team@codecombat.com') team@codecombat.com
|
||||
span.spl(data-i18n="teachers_survey.contact_2")
|
||||
else
|
||||
p(data-i18n="teachers_survey.description_1")
|
||||
p
|
||||
span.spr(data-i18n="teachers_survey.description_1b")
|
||||
a(href='/teachers', data-i18n="teachers_survey.description_2")
|
||||
span.spl(data-i18n="teachers_survey.description_3")
|
||||
p(data-i18n="teachers_survey.description_4")
|
||||
p.container-email-address
|
||||
label.control-label(data-i18n="teachers_survey.email")
|
||||
br
|
||||
span.email-address= view.email
|
||||
a(href='/account/settings') Change
|
||||
p.container-school
|
||||
label.control-label(data-i18n="teachers_survey.school")
|
||||
br
|
||||
input.control-label.input-school(type='text')
|
||||
p.container-location
|
||||
label.control-label(data-i18n="teachers_survey.location")
|
||||
br
|
||||
input.control-label.input-location(type='text')
|
||||
p.container-age
|
||||
label.control-label(data-i18n="teachers_survey.age_students")
|
||||
div
|
||||
input(type="radio", name="age", value="Under 14")
|
||||
span.spl(data-i18n="teachers_survey.under")
|
||||
span.spl 14
|
||||
div
|
||||
input(type="radio", name="age", value="14-17")
|
||||
span.spl 14-17
|
||||
div
|
||||
input(type="radio", name="age", value="18+")
|
||||
span.spl 18+
|
||||
div
|
||||
input.radio-other(type="radio", name="age", value='other')
|
||||
span.spl.spr(data-i18n="teachers_survey.other")
|
||||
input.spr.input-age-other(type='text')
|
||||
p.container-num-students
|
||||
label.control-label(data-i18n="teachers_survey.amount_students")
|
||||
br
|
||||
input.control-label.input-num-students(type='text')
|
||||
p.container-heard-about
|
||||
label.control-label(data-i18n="teachers_survey.hear_about")
|
||||
br
|
||||
textarea.control-label.input-heard-about(rows=4)
|
||||
p.error-message(data-i18n="teachers_survey.fill_fields")
|
||||
p
|
||||
button.btn.btn-default.submit-button(data-i18n="play_level.tome_submit_button")
|
||||
p.thanks-submit(data-i18n="teachers_survey.thanks")
|
|
@ -1,88 +0,0 @@
|
|||
RootView = require 'views/core/RootView'
|
||||
template = require 'templates/teachers-free-trial'
|
||||
CocoCollection = require 'collections/CocoCollection'
|
||||
TrialRequest = require 'models/TrialRequest'
|
||||
|
||||
# TODO: distinguish between this type of existing trial requests and others
|
||||
|
||||
module.exports = class TeachersFreeTrialView extends RootView
|
||||
id: 'teachers-free-trial-view'
|
||||
template: template
|
||||
logoutRedirectURL: false
|
||||
|
||||
events:
|
||||
'click .submit-button': 'onClickSubmit'
|
||||
'click .input-age-other': 'onClickTextBox'
|
||||
|
||||
constructor: (options) ->
|
||||
super options
|
||||
@email = me.get('email')
|
||||
@refreshData()
|
||||
|
||||
refreshData: ->
|
||||
@fetchingData = true
|
||||
@existingRequests = new CocoCollection([], { url: '/db/trial.request/-/own', model: TrialRequest, comparator: '_id' })
|
||||
@listenToOnce @existingRequests, 'sync', =>
|
||||
@fetchingData = false
|
||||
@render?()
|
||||
existingRequest = @existingRequests.at(0)
|
||||
if existingRequest?.get('status') isnt 'submitted' and existingRequest?.get('status') isnt 'approved'
|
||||
window.tracker?.trackEvent 'View Trial Request', category: 'Teachers', label: 'View Trial Request', ['Mixpanel']
|
||||
@supermodel.loadCollection(@existingRequests, 'own_trial_requests', {cache: false})
|
||||
|
||||
onClickTextBox: (e) ->
|
||||
$('.radio-other').prop("checked", true)
|
||||
|
||||
onClickSubmit: (e) ->
|
||||
school = $('.input-school').val()
|
||||
location = $('.input-location').val()
|
||||
age = $('input[name=age]:checked').val()
|
||||
age = $('.input-age-other').val() if age is 'other'
|
||||
numStudents = $('.input-num-students').val()
|
||||
heardAbout = $('.input-heard-about').val()
|
||||
|
||||
# Validate input
|
||||
$('.container-email-address').removeClass('has-error')
|
||||
$('.container-school').removeClass('has-error')
|
||||
$('.container-location').removeClass('has-error')
|
||||
$('.container-age').removeClass('has-error')
|
||||
$('.container-num-students').removeClass('has-error')
|
||||
$('.container-heard-about').removeClass('has-error')
|
||||
$('.error-message').hide()
|
||||
unless school
|
||||
$('.container-school').addClass('has-error')
|
||||
$('.error-message').show()
|
||||
return
|
||||
unless location
|
||||
$('.container-location').addClass('has-error')
|
||||
$('.error-message').show()
|
||||
return
|
||||
unless age
|
||||
$('.container-age').addClass('has-error')
|
||||
$('.error-message').show()
|
||||
return
|
||||
unless numStudents
|
||||
$('.container-num-students').addClass('has-error')
|
||||
$('.error-message').show()
|
||||
return
|
||||
unless heardAbout
|
||||
$('.container-heard-about').addClass('has-error')
|
||||
$('.error-message').show()
|
||||
return
|
||||
|
||||
# Save trial request
|
||||
trialRequest = new TrialRequest
|
||||
type: 'course'
|
||||
properties:
|
||||
email: @email
|
||||
school: school
|
||||
location: location
|
||||
age: age
|
||||
numStudents: numStudents
|
||||
heardAbout: heardAbout
|
||||
trialRequest.save {},
|
||||
error: (model, response, options) =>
|
||||
console.error 'Error saving trial request', response
|
||||
success: (model, response, options) =>
|
||||
@refreshData()
|
||||
window.tracker?.trackEvent 'Submit Trial Request', category: 'Teachers', label: 'Trial Request', ['Mixpanel']
|
Loading…
Add table
Add a link
Reference in a new issue