codecombat/app/views/play/level/modal/ProgressView.coffee

29 lines
940 B
CoffeeScript
Raw Normal View History

2016-01-19 18:42:20 -05:00
CocoView = require 'views/core/CocoView'
utils = require 'core/utils'
2016-01-19 18:42:20 -05:00
module.exports = class ProgressView extends CocoView
2016-01-19 18:42:20 -05:00
id: 'progress-view'
className: 'modal-content'
template: require 'templates/play/level/modal/progress-view'
events:
'click #done-btn': 'onClickDoneButton'
'click #next-level-btn': 'onClickNextLevelButton'
initialize: (options) ->
@level = options.level
@course = options.course
2016-04-13 12:54:24 -04:00
@classroom = options.classroom
2016-01-19 18:42:20 -05:00
@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, ''))
2016-01-19 18:42:20 -05:00
onClickDoneButton: ->
@trigger 'done'
onClickNextLevelButton: ->
@trigger 'next-level'