Revert using Bluebird instead of Promise polyfill

This commit is contained in:
phoenixeliot 2016-06-07 11:39:00 -07:00
commit f728c1c8a7
4 changed files with 12 additions and 96 deletions

View file

@ -165,21 +165,6 @@ module.exports = class User extends CocoModel
application.tracker.identify campaignAdsGroup: @campaignAdsGroup unless me.isAdmin() application.tracker.identify campaignAdsGroup: @campaignAdsGroup unless me.isAdmin()
@campaignAdsGroup @campaignAdsGroup
getHomepageGroup: ->
# Only testing on en-US so localization issues are not a factor
return 'home-legacy' unless _.string.startsWith(me.get('preferredLanguage', true) or 'en-US', 'en')
return @homepageGroup if @homepageGroup
group = parseInt(util.getQueryVariable('variation'))
group ?= me.get('testGroupNumber') % 5
@homepageGroup = switch group
when 0 then 'home-legacy'
when 1 then 'home-teachers'
when 2 then 'home-legacy-left'
when 3 then 'home-dropdowns'
when 4 then 'home-play-for-free'
application.tracker.identify homepageGroup: @homepageGroup unless me.isAdmin()
return @homepageGroup
# Signs and Portents was receiving updates after test started, and also had a big bug on March 4, so just look at test from March 5 on. # Signs and Portents was receiving updates after test started, and also had a big bug on March 4, so just look at test from March 5 on.
# ... and stopped working well until another update on March 10, so maybe March 11+... # ... and stopped working well until another update on March 10, so maybe March 11+...
# ... and another round, and then basically it just isn't completing well, so we pause the test until we can fix it. # ... and another round, and then basically it just isn't completing well, so we pause the test until we can fix it.

View file

@ -3,74 +3,14 @@ extends /templates/base-flat
mixin box mixin box
.well.text-center .well.text-center
if me.isAnonymous() == true if me.isAnonymous() == true
if ['home-legacy','home-legacy-left'].indexOf(view.variation) != -1 h6#classroom-edition-header(data-i18n="new_home.classroom_edition")
h6#classroom-edition-header(data-i18n="new_home.classroom_edition") div
div button.teacher-btn.btn.btn-primary.btn-lg.btn-block(data-i18n="new_home.im_a_teacher")
button.teacher-btn.btn.btn-primary.btn-lg.btn-block(data-i18n="new_home.im_a_teacher") div
div a.btn.btn-forest.btn-lg.btn-block(href="/courses", data-i18n="new_home.im_a_student")
a.btn.btn-forest.btn-lg.btn-block(href="/courses", data-i18n="new_home.im_a_student") h6#learn-to-code-header(data-i18n="new_home.learn_to_code")
h6#learn-to-code-header(data-i18n="new_home.learn_to_code") a.btn.btn-gold.btn-lg.btn-block.play-btn(href=view.playURL, data-i18n="new_home.play_now")
a.btn.btn-gold.btn-lg.btn-block.play-btn(href=view.playURL, data-i18n="new_home.play_now")
else if ['home-teachers','home-dropdowns'].indexOf(view.variation) != -1
h5#educator-header(data-i18n="new_home.teachers")
p.small(data-i18n="new_home.class_in_box")
if view.variation == 'home-dropdowns'
div.form-group
h6.control-label(data-i18n="new_home.role")
select.form-control#request-form-role
option(value="", data-i18n="new_home.form_select_role")
option(data-i18n="courses.teacher", value="Teacher")
option(data-i18n="teachers_quote.tech_coordinator", value="Technology coordinator")
option(data-i18n="teachers_quote.advisor", value="Advisor")
option(data-i18n="teachers_quote.principal", value="Principal")
option(data-i18n="teachers_quote.superintendent", value="Superintendent")
option(data-i18n="teachers_quote.parent", value="Parent")
div.form-group
h6.control-label(data-i18n="new_home.student_count")
select.form-control#request-form-range
option(value="", data-i18n="new_home.form_select_range")
option 1-10
option 11-50
option 51-100
option 101-200
option 201-500
option 501-1000
option 1000+
div
button.btn.btn-forest.btn-lg.btn-block.request-demo(href="#",data-i18n="new_home.get_started")
else
div
button.teacher-btn.btn.btn-forest.btn-lg.btn-block(data-i18n="new_home.get_started")
if view.variation == 'home-teachers'
h5#students-header(data-i18n="new_home.students")
div
button.join-class.btn.btn-primary.btn-lg.btn-block(data-i18n="new_home.join_class", href="/courses")
div
a.btn.btn-default.btn-lg.btn-block.play-btn(href=view.playURL, data-i18n="new_home.play_now")
else
h6#students-header(data-i18n="new_home.students_and_players")
div
a.btn.btn-primary.btn-lg.play-btn.btn-block(href=view.playURL, data-i18n="new_home.play_now")
else
h5#educator-header(data-i18n="new_home.start_playing_for_free")
div
a.btn.btn-forest.btn-lg.btn-block.play-btn(href=view.playURL, data-i18n="new_home.play_now")
div
button.join-class.btn.btn-default.btn-lg.btn-block(data-i18n="new_home.join_class", href="/courses")
h6#classroom-edition-header(style="padding-top: 20px",data-i18n="new_home.teachers_and_educators")
p.small(data-i18n="new_home.class_in_box")
button.teacher-btn.btn.btn-primary.btn-lg.btn-block(data-i18n="new_home.get_started")
if ['home-teachers','home-dropdowns','home-play-for-free'].indexOf(view.variation) != -1
p.small
span(data-i18n="new_home.have_an_account")
span  
a.login-button(data-i18n="login.log_in", href="#")
else else
h6#classroom-edition-header(data-i18n="new_home.logged_in_as") h6#classroom-edition-header(data-i18n="new_home.logged_in_as")
p.small #{me.get("email")} p.small #{me.get("email")}
@ -113,24 +53,16 @@ block content
.container .container
.row.hidden-xs.top-spacer(style="height: 160px") .row.hidden-xs.top-spacer(style="height: 160px")
.row.hidden-sm.hidden-xs .row.hidden-sm.hidden-xs
case view.variation .col-lg-7.col-md-8
when 'home-legacy-left' h1(data-i18n="new_home.slogan")
.col-lg-3.col-md-4 .col-lg-3.col-lg-offset-2.col-md-4
+box +box
.col-lg-7.col-lg-offset-2.col-md-8
h1(data-i18n="new_home.slogan")
default
.col-lg-7.col-md-8
h1(data-i18n="new_home.slogan")
.col-lg-3.col-lg-offset-2.col-md-4
+box
.row.hidden-lg.hidden-md .row.hidden-lg.hidden-md
.col-lg-7.col-md-8 .col-lg-7.col-md-8
h1(data-i18n="new_home.slogan") h1(data-i18n="new_home.slogan")
.col .col
div(style="margin: auto; max-width: 300px") div(style="margin: auto; max-width: 300px")
+box +box
.row#learn-more-row .row#learn-more-row
.col-xs-12.text-center .col-xs-12.text-center
a#learn-more-link a#learn-more-link

View file

@ -35,7 +35,6 @@ module.exports = class NewHomeView extends RootView
initialize: (options) -> initialize: (options) ->
@courses = new CocoCollection [], {url: "/db/course", model: Course} @courses = new CocoCollection [], {url: "/db/course", model: Course}
@supermodel.loadCollection(@courses, 'courses') @supermodel.loadCollection(@courses, 'courses')
@variation ?= me.getHomepageGroup()
window.tracker?.trackEvent 'Homepage Loaded', category: 'Homepage' window.tracker?.trackEvent 'Homepage Loaded', category: 'Homepage'
if me.isTeacher() if me.isTeacher()

View file

@ -53,7 +53,7 @@
"algoliasearch": "^3.13.1", "algoliasearch": "^3.13.1",
"algolia-autocomplete.js": "^0.17.0", "algolia-autocomplete.js": "^0.17.0",
"algolia-autocomplete-no-conflict": "1.0.0", "algolia-autocomplete-no-conflict": "1.0.0",
"bluebird": "^3.4.0" "promise-polyfill": "^5.2.1"
}, },
"overrides": { "overrides": {
"algolia-autocomplete.js": { "algolia-autocomplete.js": {