codecombat/app/templates/core/hero-select-view.jade
phoenixeliot 5b8d66cd1c Add hero selector to create account modal
Don't show grey border around Anya in signup modal

Refactor reload handling

Fix courses page updating to chosen hero
2016-08-08 15:19:44 -07:00

20 lines
659 B
Text

mixin heroOption(hero)
- var heroOriginal = hero.get('original')
- var selectedState
if state.get('selectedHeroOriginal') === heroOriginal
- selectedState = 'selected'
else if view.options.showCurrentHero && state.get('currentHeroOriginal') === heroOriginal
- selectedState = 'current'
else
- selectedState = ''
.hero-option(data-hero-original=heroOriginal, class=selectedState)
.hero-avatar
img(src=hero.getPortraitURL())
.text-h5.hero-name
span= hero.getHeroShortName()
.hero-list
if view.heroes.loaded
each hero in view.heroes.models
if hero.get('heroClass') === 'Warrior'
+heroOption(hero)