Skip to content

Commit

Permalink
- Translate string
Browse files Browse the repository at this point in the history
- Cleanup
  • Loading branch information
basicer committed Apr 14, 2017
1 parent e41b7a5 commit 72d9a27
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
1 change: 1 addition & 0 deletions app/locale/en.coffee
Expand Up @@ -153,6 +153,7 @@
brain_pop_done: "You’ve defeated the Ogres with code! You win!"
brain_pop_challenge: "Challenge yourself to play again using a different programming language!"
replay: "Replay"
back_to_classroom: "Back to Classroom"

code:
if: "if" # Keywords--these translations show up on hover, so please translate them all, even if it's kind of long. (In the code editor, they will still be in English.)
Expand Down
1 change: 0 additions & 1 deletion app/schemas/models/classroom.schema.coffee
Expand Up @@ -39,7 +39,6 @@ _.extend ClassroomSchema.properties,
backToMap: { type: 'boolean', description: 'Go back to the map after victory.', default: true }
gems: {type: 'boolean', description: 'Allow students to earn gems.', default: false}
xp: {type: 'boolean', description: 'Students collect XP and level up.', default: false}
#rob: {type: 'number', description: 'Test'}
}


Expand Down
12 changes: 6 additions & 6 deletions app/templates/courses/courses-view.jade
Expand Up @@ -121,34 +121,34 @@ mixin course-instance-body(courseInstance, classroom)
- var projectLevel = stats.levels.project;
if arenaLevel
- var url = view.urls.courseArenaLadder({level: view.originalLevelMap[arenaLevel.get('original')] || arenaLevel, courseInstance: courseInstance});
a.play-btn.btn.btn-forest-alt.btn-lg.m-b-1(href=url, data-level-slug=arenaLevel.get('slug'), data-event-action="Students Play Arena")
a.play-btn.btn.btn-forest-alt.btn-lg.m-b-1(data-href=url, data-level-slug=arenaLevel.get('slug'), data-event-action="Students Play Arena")
span(data-i18n="courses.play_arena")
else if projectLevel
- var url = view.urls.courseLevel({level: view.originalLevelMap[projectLevel.get('original')] || projectLevel, courseInstance: courseInstance});
a.play-btn.btn.btn-forest-alt.btn-lg.m-b-1(href=url, data-level-slug=projectLevel.get('slug'), data-event-action="Students Play Project")
a.play-btn.btn.btn-forest-alt.btn-lg.m-b-1(data-href=url, data-level-slug=projectLevel.get('slug'), data-event-action="Students Play Project")
span(data-i18n="courses.view_project")
else
a.btn.btn-default.btn-lg.m-b-1(disabled=true, data-i18n="courses.course_complete")
else if stats.levels.next != stats.levels.first
- var next = stats.levels.next;
- var mapurl = view.urls.courseWorldMap({course: course, courseInstance: courseInstance});
if classroom.getSetting('map')
a.play-btn.btn.btn-forest.btn-lg.m-b-1(href=mapurl, data-level-slug=next.get('slug'), data-event-action="Students Continue Course")
a.play-btn.btn.btn-forest.btn-lg.m-b-1(data-href=mapurl, data-level-slug=next.get('slug'), data-event-action="Students Continue Course")
span(data-i18n="common.continue")
else
- var url = view.urls.courseLevel({level: view.originalLevelMap[next.get('original')] || next, courseInstance: courseInstance});
a.play-btn.btn.btn-forest.btn-lg.m-b-1(href=url, data-level-slug=next.get('slug'), data-event-action="Students Continue Course")
a.play-btn.btn.btn-forest.btn-lg.m-b-1(data-href=url, data-level-slug=next.get('slug'), data-event-action="Students Continue Course")
span(data-i18n="common.continue")

else
- var firstLevel = stats.levels.first;
if classroom.getSetting('map')
- var url = view.urls.courseWorldMap({course: course, courseInstance: courseInstance});
a.play-btn.btn.btn-navy.btn-lg.m-b-1(href=url, data-event-action="Students Start Course")
a.play-btn.btn.btn-navy.btn-lg.m-b-1(data-href=url, data-event-action="Students Start Course")
span(data-i18n="courses.start")
else
- var url = view.urls.courseLevel({level: view.originalLevelMap[firstLevel.get('original')] || firstLevel, courseInstance: courseInstance, classroom: classroom});
a.btn.btn-navy.btn-lg.m-b-1(href=url, data-level-slug=firstLevel.get('slug'), data-event-action="Students Start Course")
a.play-btn.btn.btn-navy.btn-lg.m-b-1(data-href=url, data-level-slug=firstLevel.get('slug'), data-event-action="Students Start Course")
span(data-i18n="courses.start")


Expand Down
7 changes: 5 additions & 2 deletions app/templates/play/campaign-view.jade
Expand Up @@ -30,7 +30,7 @@ if view.showAds()
img(src="/images/pages/base/logo.png", title="Powered by CodeCombat - Learn how to code by playing a game ", alt="Powered by CodeCombat")

if view.shouldShow('back-to-classroom')
a.btn.btn-primary.under-logo(href='/play') Back to Classroom
a.btn.btn-primary.under-logo(href='/play', data-i18n="play.back_to_classroom")

if serverConfig.codeNinjas
a(href="https://code.ninja")
Expand Down Expand Up @@ -255,7 +255,10 @@ if view.showAds()
button.btn.btn-illustrated.login-button.btn-warning(data-i18n="login.log_in")
button.btn.btn-illustrated.signup-button.btn-danger(data-i18n="signup.sign_up")
else
a(href="/account").player-name.spr= me.get('name')
if me.get('role') == "student"
a(href="/play").player-name.spr= me.get('name')
else
a(href="/account").player-name.spr= me.get('name')
if !features.codePlay
button#logout-button.btn.btn-illustrated.btn-warning(data-i18n="login.log_out") Log Out
if me.isPremium()
Expand Down
11 changes: 4 additions & 7 deletions app/views/play/CampaignView.coffee
Expand Up @@ -129,14 +129,11 @@ module.exports = class CampaignView extends RootView

if @getQueryVariable('course-instance')?
@courseLevelsFake = {}
console.log "Cascade Load", @getQueryVariable('course-instance')
@courseInstanceID = @getQueryVariable('course-instance')
@courseInstance = new CourseInstance(_id: @courseInstanceID)
jqxhr = @courseInstance.fetch()
@supermodel.trackRequest(jqxhr)
new Promise(jqxhr.then).then(=>
console.log("LoadeD", c: @courseInstance.get('classroomID'), d: @courseInstance.get('courseID'))

courseID = @courseInstance.get('courseID')

@course = new Course(_id: courseID)
Expand Down Expand Up @@ -168,13 +165,11 @@ module.exports = class CampaignView extends RootView

@listenToOnce @courseLevels, 'sync', =>
existing = @campaign.get('levels')
console.log "Sync", existing
for k,v of @courseLevels.toArray()
idx = v.get('original')
@courseLevelsFake[idx] = existing[idx]
@courseLevelsFake[idx].courseIdx = parseInt(k)
@courseLevelsFake[idx].requiresSubscription = false
console.log "Fake is ", @courseLevelsFake

)

Expand Down Expand Up @@ -1087,7 +1082,10 @@ module.exports = class CampaignView extends RootView
@campaign?.get('levels')

applyCourseLogicToLevels: (orderedLevels) ->
nextSlug = @courseStats.levels.next.get('slug')
nextSlug = @courseStats.levels.next?.get('slug')
nextSlug ?= @courseStats.levels.first.get('slug')
return unless nextSlug

courseOrder = _.sortBy orderedLevels, 'courseIdx'
found = false
for level, levelIndex in courseOrder
Expand All @@ -1096,7 +1094,6 @@ module.exports = class CampaignView extends RootView
level.disabled = false

if level.slug is nextSlug
console.log "Next for you is #{level.name}", level
level.locked = false
level.hidden = level.locked
level.color = 'rgb(255, 80, 60)'
Expand Down

0 comments on commit 72d9a27

Please sign in to comment.