Turn off video tutorials for course levels

This commit is contained in:
Matt Lott 2016-05-31 10:12:20 -07:00
parent 4f369a1e2f
commit ffcd89d327
2 changed files with 6 additions and 5 deletions
app
locale
views/play/menu

View file

@ -1711,7 +1711,7 @@ module.exports = nativeDescription: "Español (América Latina)", englishDescrip
you_can2: "comprar un código prepagado"
you_can3: "que puede ser aplicado a tu propia cuenta o regalado a otros."
coppa_deny:
# coppa_deny:
# text1: "Cant wait to learn programming?"
# text2: "Ask your parents to create an account for you!"
# close: "Cerrar ventana"

View file

@ -19,12 +19,13 @@ module.exports = class LevelGuideView extends CocoView
@levelSlug = options.level.get('slug')
@sessionID = options.session.get('_id')
@requiresSubscription = not me.isPremium()
@helpVideos = options.level.get('helpVideos') ? []
@isCourseLevel = options.level.get('type', true) in ['course', 'course-ladder']
@helpVideos = if @isCourseLevel then [] else options.level.get('helpVideos') ? []
@trackedHelpVideoStart = @trackedHelpVideoFinish = false
# A/B Testing video tutorial styles
@helpVideosIndex = me.getVideoTutorialStylesIndex(@helpVideos.length)
@helpVideo = @helpVideos[@helpVideosIndex] if @helpVideos.length > 0
@videoLocked = not (@helpVideo?.free or options.level.get('type', true) in ['course', 'course-ladder']) and @requiresSubscription
@helpVideo = @helpVideos[@helpVideosIndex] if @helpVideos.length > 0 and not @isCourseLevel
@videoLocked = not (@helpVideo?.free or @isCourseLevel) and @requiresSubscription
@firstOnly = options.firstOnly
@docs = options?.docs ? options.level.get('documentation') ? {}
@ -57,7 +58,7 @@ module.exports = class LevelGuideView extends CocoView
getRenderData: ->
c = super()
c.docs = @docs
c.showVideo = @helpVideos.length > 0
c.showVideo = @helpVideos.length > 0 unless @isCourseLevel
c.videoLocked = @videoLocked
c