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"
play_level:
completed_level: "Completed Level:"
course: "Course:"
done: "Done"
next_level: "Next Level:"
next_game: "Next game"
show_menu: "Show game menu"
home: "Home" # Not used any more, will be removed soon.

View file

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

View file

@ -11,6 +11,7 @@ LadderSubmissionView = require 'views/play/common/LadderSubmissionView'
AudioPlayer = require 'lib/AudioPlayer'
User = require 'models/User'
utils = require 'core/utils'
Course = require 'models/Course'
Level = require 'models/Level'
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')
@nextLevel = new Level().setURL "/db/level/#{nextLevel.original}/version/#{nextLevel.majorVersion}"
@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']
@saveReviewEventually = _.debounce(@saveReviewEventually, 2000)
@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.isCourseLevel = @level.get('type', true) in ['course']
c.currentCourseName = @course?.get('name')
c.currentLevelName = @level?.get('name')
c.nextLevelName = @nextLevel?.get('name')