Merge branch 'master' into production

This commit is contained in:
Scott Erickson 2016-08-08 11:50:47 -07:00
commit 3d024ce349
8 changed files with 55 additions and 21 deletions

View file

@ -102,7 +102,7 @@ module.exports = nativeDescription: "magyar", englishDescription: "Hungarian", t
blog: "Blog" blog: "Blog"
forum: "Fórum" forum: "Fórum"
account: "Fiók" account: "Fiók"
# my_account: "My Account" my_account: "Fiókom"
profile: "Profil" profile: "Profil"
stats: "Statisztika" stats: "Statisztika"
code: "Kód" code: "Kód"
@ -112,18 +112,18 @@ module.exports = nativeDescription: "magyar", englishDescription: "Hungarian", t
about: "Rólunk" about: "Rólunk"
contact: "Kapcsolat" contact: "Kapcsolat"
twitter_follow: "Követés" twitter_follow: "Követés"
# students: "Students" students: "Diákok"
teachers: "Tanárok" teachers: "Tanárok"
careers: "Karrier" careers: "Karrier"
# facebook: "Facebook" facebook: "Facebook"
# twitter: "Twitter" twitter: "Twitter"
create_a_class: "Hozz létre egy Osztályt" create_a_class: "Hozz létre egy Osztályt"
other: "Egyéb" other: "Egyéb"
learn_to_code: "Tanulj meg Kódolni!" learn_to_code: "Tanulj meg Kódolni!"
# toggle_nav: "Toggle navigation" # toggle_nav: "Toggle navigation"
# jobs: "Jobs" jobs: "Állások"
# schools: "Schools" schools: "Iskolák"
# educator_wiki: "Educator Wiki" educator_wiki: "Oktatói Wiki"
# get_involved: "Get Involved" # get_involved: "Get Involved"
# open_source: "Open source (GitHub)" # open_source: "Open source (GitHub)"
# support: "Support" # support: "Support"
@ -132,8 +132,8 @@ module.exports = nativeDescription: "magyar", englishDescription: "Hungarian", t
# help_suff: "and we'll get in touch!" # help_suff: "and we'll get in touch!"
modal: modal:
# cancel: "Cancel" cancel: "Mégse"
close: "Mégse" close: "Bezár"
okay: "Oké" okay: "Oké"
not_found: not_found:
@ -390,7 +390,7 @@ module.exports = nativeDescription: "magyar", englishDescription: "Hungarian", t
subject: "Tárgy" subject: "Tárgy"
email: "E-mail" email: "E-mail"
password: "Jelszó" password: "Jelszó"
# confirm_password: "Confirm Password" confirm_password: "Jelszó megerősítése"
message: "Üzenet" message: "Üzenet"
code: "Kód" code: "Kód"
ladder: "Ranglétra" ladder: "Ranglétra"

View file

@ -1,6 +1,6 @@
#systems-documentation-view #systems-documentation-view
background-color: #e4cf8c background-color: #e4cf8c
height: 100% height: calc(100% - 90px)
#toggle-all-system-code #toggle-all-system-code
margin: 10px margin: 10px

View file

@ -13,6 +13,10 @@ $level-resize-transition-time: 0.5s
&.real-time &.real-time
// Hmm, somehow the #page-container is cutting us off by ~17px on the right, looks a bit off. // Hmm, somehow the #page-container is cutting us off by ~17px on the right, looks a bit off.
&.real-time.game-dev
#canvas-wrapper
width: 80%
#canvas-wrapper #canvas-wrapper
width: 100% width: 100%
canvas canvas
@ -295,6 +299,13 @@ $level-resize-transition-time: 0.5s
left: 0 left: 0
bottom: 0 bottom: 0
#how-to-play-game-dev-panel
position: absolute
right: 0
top: 52px
width: 20%
bottom: 38px
html.fullscreen-editor html.fullscreen-editor
#level-view #level-view
#fullscreen-editor-background-screen #fullscreen-editor-background-screen

View file

@ -56,7 +56,7 @@ if view.showAds()
else else
span(data-i18n="play_level.skip") span(data-i18n="play_level.skip")
#how-to-play-game-dev-panel.panel.panel-default.hide #how-to-play-game-dev-panel.panel.panel-default.hide.style-flat
.panel-heading .panel-heading
h3.panel-title How to play: h3.panel-title How to play:
.panel-body .panel-body

View file

@ -165,7 +165,7 @@ module.exports = class LevelEditView extends RootView
if me.get('name') is 'Nick' if me.get('name') is 'Nick'
@childWindow = window.open("/play/level/#{scratchLevelID}", 'child_window', 'width=2560,height=1080,left=0,top=-1600,location=1,menubar=1,scrollbars=1,status=0,titlebar=1,toolbar=1', true) @childWindow = window.open("/play/level/#{scratchLevelID}", 'child_window', 'width=2560,height=1080,left=0,top=-1600,location=1,menubar=1,scrollbars=1,status=0,titlebar=1,toolbar=1', true)
else else
@childWindow = window.open("/play/level/#{scratchLevelID}", 'child_window', 'width=1024,height=560,left=10,top=10,location=0,menubar=0,scrollbars=0,status=0,titlebar=0,toolbar=0', true) @childWindow = window.open("/play/level/#{scratchLevelID}", 'child_window', 'width=1280,height=640,left=10,top=10,location=0,menubar=0,scrollbars=0,status=0,titlebar=0,toolbar=0', true)
@childWindow.onPlayLevelViewLoaded = (e) => sendLevel() # still a hack @childWindow.onPlayLevelViewLoaded = (e) => sendLevel() # still a hack
@childWindow.focus() @childWindow.focus()

View file

@ -635,7 +635,22 @@ module.exports = class PlayLevelView extends RootView
# Real-time playback # Real-time playback
onRealTimePlaybackStarted: (e) -> onRealTimePlaybackStarted: (e) ->
@$el.addClass('real-time').focus() @$el.addClass('real-time').focus()
@$('#how-to-play-game-dev-panel').removeClass('hide') if @level.isType('game-dev') if @level.isType('game-dev')
panel = @$('#how-to-play-game-dev-panel')
panel.removeClass('hide')
lines = switch @level.get('slug')
when 'over-the-garden-wall' then ['Watch to see if the peasants are properly protected.']
when 'click-gait' then ['Move to each red "X".', 'Click on the screen to move the Knight there.']
when 'heros-journey' then ['Move to each red "X".', 'Click on the screen to move the Knight there.']
when 'a-maze-ing' then ['Move to the chest of gems.', 'Click on the screen to move the Duelist there.']
when 'gemtacular' then ['Move to each of the gems.', 'Click on the screen to move the Captain there.']
when 'vorpal-mouse' then ['Slay the ogres.', 'Click on the screen to move the Guardian there.', 'Click on the munchkins to attack them!']
when 'crushing-it' then ['Slay the ogres.', 'Click on the screen to move the Goliath there.', 'Click on the munchkins to attack them!']
when 'tabula-rasa' then ['Slay any ogres.', 'Collect any coins.', 'Click on the screen to move the Raider there.', 'Click on any munchkins to attack them!']
else ['Click to control your hero and win your game!']
html = _.map(lines, (line) -> "<p>#{line}</p>").join('')
panel.find('.panel-body').html(html)
@onWindowResize() @onWindowResize()
onRealTimePlaybackEnded: (e) -> onRealTimePlaybackEnded: (e) ->

View file

@ -51,12 +51,14 @@ module.exports =
getProjectFromReq: (req, options) -> getProjectFromReq: (req, options) ->
options = _.extend({}, options) options = _.extend({}, options)
return null unless req.query.project return null unless req.query.project
projection = {} result = {}
project = req.query.project
if req.query.project is 'true' if project is 'true'
projection = {original: 1, name: 1, version: 1, description: 1, slug: 1, kind: 1, created: 1, permissions: 1} result = {original: 1, name: 1, version: 1, description: 1, slug: 1, kind: 1, created: 1, permissions: 1}
else else
for field in req.query.project.split(',') if _.isString(project)
projection[field] = 1 project = project.split(',')
for field in project
result[field] = 1
return projection return result

View file

@ -29,6 +29,12 @@ describe 'GET /db/campaign', ->
expect(body.length).toBe(4) expect(body.length).toBe(4)
done() done()
it 'accepts project parameter with [] notation', utils.wrap (done) ->
[res, body] = yield request.getAsync getURL('/db/campaign?project[]=name&project[]=type'), { json: true }
expect(res.statusCode).toBe(200)
expect(res.body[0].slug).toBeUndefined()
done()
describe 'with GET query param type', -> describe 'with GET query param type', ->
it 'returns campaigns of that type', utils.wrap (done) -> it 'returns campaigns of that type', utils.wrap (done) ->
[res, body] = yield request.getAsync getURL('/db/campaign?type=course'), { json: true } [res, body] = yield request.getAsync getURL('/db/campaign?type=course'), { json: true }