Don't show tutorial level link if tutorial level doesn't exist for a ladder level.

This commit is contained in:
Nick Winter 2014-04-28 10:54:03 -07:00
parent 0de5e715c7
commit 4a2f2700bc
2 changed files with 8 additions and 6 deletions
app
templates/play/ladder
views/play/ladder

View file

@ -14,10 +14,11 @@ block modal-body-content
div#normal-view
p.tutorial-suggestion
strong(data-i18n="ladder.tutorial_not_sure") Not sure what's going on?
|
a(href="/play/level/#{levelID}-tutorial", data-i18n="ladder.tutorial_play_first") Play the tutorial first.
if tutorialLevelExists
p.tutorial-suggestion
strong(data-i18n="ladder.tutorial_not_sure") Not sure what's going on?
|
a(href="/play/level/#{levelID}-tutorial", data-i18n="ladder.tutorial_play_first") Play the tutorial first.
a(href="/play/level/#{levelID}?team=#{teamID}")
div.play-option

View file

@ -22,7 +22,7 @@ module.exports = class LadderPlayModal extends View
@otherTeam = if team is 'ogres' then 'humans' else 'ogres'
@startLoadingChallengersMaybe()
@wizardType = ThangType.loadUniversalWizard()
# PART 1: Load challengers from the db unless some are in the matches
startLoadingChallengersMaybe: ->
@ -72,6 +72,7 @@ module.exports = class LadderPlayModal extends View
ctx.teamName = _.string.titleize @team
ctx.teamID = @team
ctx.otherTeamID = @otherTeam
ctx.tutorialLevelExists = @tutorialLevelExists
teamsList = teamDataFromLevel @level
teams = {}
@ -118,7 +119,7 @@ module.exports = class LadderPlayModal extends View
url: "/db/level/#{tutorialLevelID}/exists"
success: success
error: failure
# Choosing challengers
getChallengers: ->