Add course name to victory modal

This commit is contained in:
Matt Lott 2015-11-25 14:23:35 -08:00
parent 022cdf6d6e
commit 7b01fd7b65
3 changed files with 16 additions and 4 deletions

View file

@ -221,7 +221,10 @@
years: "years" years: "years"
play_level: play_level:
completed_level: "Completed Level:"
course: "Course:"
done: "Done" done: "Done"
next_level: "Next Level:"
next_game: "Next game" next_game: "Next game"
show_menu: "Show game menu" show_menu: "Show game menu"
home: "Home" # Not used any more, will be removed soon. home: "Home" # Not used any more, will be removed soon.

View file

@ -12,16 +12,20 @@ block modal-body-content
#victory-text= victoryText #victory-text= victoryText
if isCourseLevel if isCourseLevel
if currentCourseName
p
span.spr.level-title(data-i18n="play_level.course")
span.level-name= currentCourseName
.container-fluid .container-fluid
.row .row
.col-md-6 .col-md-6
if currentLevelName if currentLevelName
.level-title Completed Level: .level-title(data-i18n="play_level.completed_level")
.level-name= currentLevelName .level-name= currentLevelName.replace('Course: ', '')
.col-md-6 .col-md-6
if nextLevelName if nextLevelName
.level-title Next Level: .level-title(data-i18n="play_level.next_level")
.level-name= nextLevelName .level-name= nextLevelName.replace('Course: ', '')
br br
#level-feedback #level-feedback

View file

@ -11,6 +11,7 @@ LadderSubmissionView = require 'views/play/common/LadderSubmissionView'
AudioPlayer = require 'lib/AudioPlayer' AudioPlayer = require 'lib/AudioPlayer'
User = require 'models/User' User = require 'models/User'
utils = require 'core/utils' utils = require 'core/utils'
Course = require 'models/Course'
Level = require 'models/Level' Level = require 'models/Level'
LevelFeedback = require 'models/LevelFeedback' LevelFeedback = require 'models/LevelFeedback'
@ -65,6 +66,9 @@ module.exports = class HeroVictoryModal extends ModalView
if @level.get('type', true) is 'course' and nextLevel = @level.get('nextLevel') if @level.get('type', true) is 'course' and nextLevel = @level.get('nextLevel')
@nextLevel = new Level().setURL "/db/level/#{nextLevel.original}/version/#{nextLevel.majorVersion}" @nextLevel = new Level().setURL "/db/level/#{nextLevel.original}/version/#{nextLevel.majorVersion}"
@nextLevel = @supermodel.loadModel(@nextLevel, 'level').model @nextLevel = @supermodel.loadModel(@nextLevel, 'level').model
if @courseID
@course = new Course().setURL "/db/course/#{@courseID}"
@course = @supermodel.loadModel(@course, 'course').model
if @level.get('type', true) in ['course', 'course-ladder'] if @level.get('type', true) in ['course', 'course-ladder']
@saveReviewEventually = _.debounce(@saveReviewEventually, 2000) @saveReviewEventually = _.debounce(@saveReviewEventually, 2000)
@loadExistingFeedback() @loadExistingFeedback()
@ -210,6 +214,7 @@ module.exports = class HeroVictoryModal extends ModalView
c.showReturnToCourse = not c.showLeaderboard and not me.get('anonymous') and @level.get('type', true) in ['course', 'course-ladder'] c.showReturnToCourse = not c.showLeaderboard and not me.get('anonymous') and @level.get('type', true) in ['course', 'course-ladder']
c.isCourseLevel = @level.get('type', true) in ['course'] c.isCourseLevel = @level.get('type', true) in ['course']
c.currentCourseName = @course?.get('name')
c.currentLevelName = @level?.get('name') c.currentLevelName = @level?.get('name')
c.nextLevelName = @nextLevel?.get('name') c.nextLevelName = @nextLevel?.get('name')