diff --git a/app/locale/hu.coffee b/app/locale/hu.coffee index caa6b9cc3..679cdfb95 100644 --- a/app/locale/hu.coffee +++ b/app/locale/hu.coffee @@ -102,7 +102,7 @@ module.exports = nativeDescription: "magyar", englishDescription: "Hungarian", t blog: "Blog" forum: "Fórum" account: "Fiók" -# my_account: "My Account" + my_account: "Fiókom" profile: "Profil" stats: "Statisztika" code: "Kód" @@ -112,18 +112,18 @@ module.exports = nativeDescription: "magyar", englishDescription: "Hungarian", t about: "Rólunk" contact: "Kapcsolat" twitter_follow: "Követés" -# students: "Students" + students: "Diákok" teachers: "Tanárok" careers: "Karrier" -# facebook: "Facebook" -# twitter: "Twitter" + facebook: "Facebook" + twitter: "Twitter" create_a_class: "Hozz létre egy Osztályt" other: "Egyéb" learn_to_code: "Tanulj meg Kódolni!" # toggle_nav: "Toggle navigation" -# jobs: "Jobs" -# schools: "Schools" -# educator_wiki: "Educator Wiki" + jobs: "Állások" + schools: "Iskolák" + educator_wiki: "Oktatói Wiki" # get_involved: "Get Involved" # open_source: "Open source (GitHub)" # support: "Support" @@ -132,8 +132,8 @@ module.exports = nativeDescription: "magyar", englishDescription: "Hungarian", t # help_suff: "and we'll get in touch!" modal: -# cancel: "Cancel" - close: "Mégse" + cancel: "Mégse" + close: "Bezár" okay: "Oké" not_found: @@ -390,7 +390,7 @@ module.exports = nativeDescription: "magyar", englishDescription: "Hungarian", t subject: "Tárgy" email: "E-mail" password: "Jelszó" -# confirm_password: "Confirm Password" + confirm_password: "Jelszó megerősítése" message: "Üzenet" code: "Kód" ladder: "Ranglétra" diff --git a/app/styles/docs/systems-documentation-view.sass b/app/styles/docs/systems-documentation-view.sass index 8af063555..c9443b963 100644 --- a/app/styles/docs/systems-documentation-view.sass +++ b/app/styles/docs/systems-documentation-view.sass @@ -1,6 +1,6 @@ #systems-documentation-view background-color: #e4cf8c - height: 100% + height: calc(100% - 90px) #toggle-all-system-code margin: 10px diff --git a/app/styles/play/play-level-view.sass b/app/styles/play/play-level-view.sass index a0a560ff9..ba0ff6a37 100644 --- a/app/styles/play/play-level-view.sass +++ b/app/styles/play/play-level-view.sass @@ -12,6 +12,10 @@ $level-resize-transition-time: 0.5s &.real-time // 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 width: 100% @@ -294,6 +298,13 @@ $level-resize-transition-time: 0.5s right: 0 left: 0 bottom: 0 + + #how-to-play-game-dev-panel + position: absolute + right: 0 + top: 52px + width: 20% + bottom: 38px html.fullscreen-editor #level-view diff --git a/app/templates/play/play-level-view.jade b/app/templates/play/play-level-view.jade index ad0687b5b..ef8f92ee5 100644 --- a/app/templates/play/play-level-view.jade +++ b/app/templates/play/play-level-view.jade @@ -56,7 +56,7 @@ if view.showAds() else 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 h3.panel-title How to play: .panel-body diff --git a/app/views/editor/level/LevelEditView.coffee b/app/views/editor/level/LevelEditView.coffee index 76725f5d5..0f9b0d216 100644 --- a/app/views/editor/level/LevelEditView.coffee +++ b/app/views/editor/level/LevelEditView.coffee @@ -165,7 +165,7 @@ module.exports = class LevelEditView extends RootView 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) 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.focus() diff --git a/app/views/play/level/PlayLevelView.coffee b/app/views/play/level/PlayLevelView.coffee index 733e4c059..f8ad85119 100644 --- a/app/views/play/level/PlayLevelView.coffee +++ b/app/views/play/level/PlayLevelView.coffee @@ -635,7 +635,22 @@ module.exports = class PlayLevelView extends RootView # Real-time playback onRealTimePlaybackStarted: (e) -> @$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) -> "
#{line}
").join('') + panel.find('.panel-body').html(html) + @onWindowResize() onRealTimePlaybackEnded: (e) -> diff --git a/server/commons/parse.coffee b/server/commons/parse.coffee index e00019f95..44c1f6c9b 100644 --- a/server/commons/parse.coffee +++ b/server/commons/parse.coffee @@ -51,12 +51,14 @@ module.exports = getProjectFromReq: (req, options) -> options = _.extend({}, options) return null unless req.query.project - projection = {} - - if req.query.project is 'true' - projection = {original: 1, name: 1, version: 1, description: 1, slug: 1, kind: 1, created: 1, permissions: 1} + result = {} + project = req.query.project + if project is 'true' + result = {original: 1, name: 1, version: 1, description: 1, slug: 1, kind: 1, created: 1, permissions: 1} else - for field in req.query.project.split(',') - projection[field] = 1 + if _.isString(project) + project = project.split(',') + for field in project + result[field] = 1 - return projection + return result diff --git a/spec/server/functional/campaign.spec.coffee b/spec/server/functional/campaign.spec.coffee index e14a0cb0f..6b32ab0e1 100644 --- a/spec/server/functional/campaign.spec.coffee +++ b/spec/server/functional/campaign.spec.coffee @@ -29,6 +29,12 @@ describe 'GET /db/campaign', -> expect(body.length).toBe(4) 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', -> it 'returns campaigns of that type', utils.wrap (done) -> [res, body] = yield request.getAsync getURL('/db/campaign?type=course'), { json: true }