Merge branch 'master' into production

This commit is contained in:
Nick Winter 2015-12-02 14:57:11 -08:00
commit 03e46cec22
6 changed files with 20 additions and 8 deletions

View file

@ -1,6 +1,8 @@
#choose-language-modal
button
margin: 20px 0 10px
img
width: 30px
.progress
width: 50%

View file

@ -8,10 +8,14 @@ block modal-header-content
block modal-body-content
#choice-area.text-center
button.lang-choice-btn.btn.btn-success.btn-lg(data-language='python') Python
button.lang-choice-btn.btn.btn-success.btn-lg(data-language='python')
img(src="/images/common/code_languages/python_small.png")
span.spl Python
p(data-i18n="choose_hero.python_blurb")
button.lang-choice-btn.btn.btn-default(data-language='javascript') JavaScript
button.lang-choice-btn.btn.btn-default(data-language='javascript')
img(src="/images/common/code_languages/javascript_small.png")
span.spl JavaScript
p(data-i18n="choose_hero.javascript_blurb")
#saving-progress.progress.progress-striped.active.hide

View file

@ -18,7 +18,7 @@ block content
strong= me.get('name') || me.get('email')
p
span.spr This isn't you?
span.spr Not you?
a#log-out-link Logout
hr
@ -34,7 +34,7 @@ block content
p
strong Hi adventurer, welcome back!
p
a#continue-playing-btn.btn.btn-default(href=view.continuePlayingLink()) Continue playing
a#continue-playing-btn.btn.btn-success.btn-lg(href=view.continuePlayingLink()) Continue Playing
p
em.spr
span.spr Last Played:
@ -44,13 +44,13 @@ block content
p
strong More options:
p
button#start-new-game-btn.btn.btn-default Start New Game
button#start-new-game-btn.btn.btn-default.btn-lg Start New Game
if me.isAnonymous()
p - OR -
p
button#log-in-btn.btn.btn-default(data-i18n="login.log_in")
button#log-in-btn.btn.btn-default.btn-lg(data-i18n="login.log_in")
#begin-hoc-area.hide
h2.text-center(data-i18n="common.loading")

View file

@ -24,5 +24,7 @@ block modal-body-content
input#log-in-btn.btn.btn-default(data-i18n="[value]login.log_in", type="submit")
p
a#create-new-account-link(data-i18n="login.signup_switch")
p
a(data-toggle="coco-modal", data-target="core/RecoverModal", data-i18n="login.forgot_password") Forgot your password?
block modal-footer-content

View file

@ -26,6 +26,10 @@ module.exports = class StudentSignInModal extends ModalView
auth.loginUser data, (jqxhr) =>
error = jqxhr.responseJSON[0]
message = _.filter([error.property, error.message]).join(' ')
if message is 'Missing credentials'
message = 'Enter both username and password'
# TODO: Make the server return better error message
message = _.string.capitalize(message)
@disableModalInProgress(@$el)
@$('#errors-alert').text(message).removeClass('hide')

View file

@ -424,7 +424,7 @@ module.exports = class PlayLevelView extends RootView
@simulator.fetchAndSimulateOneGame()
shouldSimulate: ->
return false # Performance is too bad right now, gotta fix it first.
return @getQueryVariable('simulate') is true # Performance is too bad right now, gotta fix it first.
# Crude heuristics are crude.
defaultCores = 2
cores = window.navigator.hardwareConcurrency or defaultCores # Available on Chrome/Opera, soon Safari