mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-16 00:19:50 -05:00
Make CourseVictoryModal respect Markdown in next level description
This commit is contained in:
parent
904d58a8ef
commit
065069cfdd
2 changed files with 7 additions and 3 deletions
|
@ -38,7 +38,7 @@
|
|||
span :
|
||||
h2.text-uppercase= i18n(view.nextLevel.attributes, 'name')
|
||||
|
||||
p= i18n(view.nextLevel.attributes, 'description')
|
||||
div!= view.nextLevelDescription
|
||||
|
||||
.row
|
||||
.col-sm-5.col-sm-offset-2
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
CocoView = require 'views/core/CocoView'
|
||||
utils = require 'core/utils'
|
||||
|
||||
module.exports = class ProgressView extends CocoView
|
||||
|
||||
|
||||
id: 'progress-view'
|
||||
className: 'modal-content'
|
||||
template: require 'templates/play/level/modal/progress-view'
|
||||
|
@ -16,9 +17,12 @@ module.exports = class ProgressView extends CocoView
|
|||
@classroom = options.classroom
|
||||
@nextLevel = options.nextLevel
|
||||
@levelSessions = options.levelSessions
|
||||
# Translate and Markdownify level description, but take out any images (we don't have room for arena banners, etc.).
|
||||
# Images in Markdown are like ![description](url)
|
||||
@nextLevelDescription = marked(utils.i18n(@nextLevel.attributes, 'description').replace(/!\[.*?\]\(.*?\)\n*/g, ''))
|
||||
|
||||
onClickDoneButton: ->
|
||||
@trigger 'done'
|
||||
|
||||
onClickNextLevelButton: ->
|
||||
@trigger 'next-level'
|
||||
@trigger 'next-level'
|
||||
|
|
Loading…
Reference in a new issue