From 7b01fd7b653dff4d85ab81eb85b8c3a8aff0ae43 Mon Sep 17 00:00:00 2001 From: Matt Lott Date: Wed, 25 Nov 2015 14:23:35 -0800 Subject: [PATCH] Add course name to victory modal --- app/locale/en.coffee | 3 +++ .../play/level/modal/hero-victory-modal.jade | 12 ++++++++---- app/views/play/level/modal/HeroVictoryModal.coffee | 5 +++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/app/locale/en.coffee b/app/locale/en.coffee index 849a982cd..98dd2aabf 100644 --- a/app/locale/en.coffee +++ b/app/locale/en.coffee @@ -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. diff --git a/app/templates/play/level/modal/hero-victory-modal.jade b/app/templates/play/level/modal/hero-victory-modal.jade index e440a2e06..ba5188fa1 100644 --- a/app/templates/play/level/modal/hero-victory-modal.jade +++ b/app/templates/play/level/modal/hero-victory-modal.jade @@ -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 diff --git a/app/views/play/level/modal/HeroVictoryModal.coffee b/app/views/play/level/modal/HeroVictoryModal.coffee index ae8e54ca9..7698e9fe0 100644 --- a/app/views/play/level/modal/HeroVictoryModal.coffee +++ b/app/views/play/level/modal/HeroVictoryModal.coffee @@ -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')