Files
habitica/website/views/shared/profiles/stats.jade
T
2015-07-18 16:00:08 -05:00

72 lines
3.5 KiB
Plaintext

mixin basicRow(label, value)
tr&attributes(attributes)
td
strong=env.t(label)
| : #{value}
mixin statList(calculatedStat, popover, text, useOneTimeBinding)
- var binding = useOneTimeBinding ? "::" : ""
li(ng-if=binding + '#{calculatedStat} > 0')
span.hint(popover-title=env.t('#{popover}'), popover-trigger='mouseenter',
popover-placement='top', popover=env.t('#{popover}Text'))
=env.t(text)
=': {{' + binding + calculatedStat + '}}'
h4(class=mobile?'item item-divider':'')=env.t('stats')
table.table.table-striped
+basicRow('health', '{{::statCalc.hpDisplay(profile.stats.hp)}}')
+basicRow('mana', '{{statCalc.mpDisplay(profile)}}')(ng-if='profile.stats.lvl >= 10 && !profile.preferences.disableClasses')
+basicRow('gold', '{{::statCalc.goldDisplay(profile.stats.gp)}}')
+basicRow('level', '{{::profile.stats.lvl}}')
+basicRow('experience', '{{::statCalc.expDisplay(profile)}}')
unless mobile
h4.stats-equipment(class=mobile?'item item-divider':'',
ng-show='user.flags.itemsEnabled')=env.t('equipment')
table.table.table-striped(ng-show='user.flags.itemsEnabled')
tr(ng-repeat='(itemType,gear) in profile.items.gear.equipped',
ng-init='piece=Content.gear.flat[gear]', ng-show='piece')
td
strong {{piece.text()}}: 
span(ng-repeat='stat in ["str","con","per","int"]', ng-show='piece[stat]') {{piece[stat]}} {{stat.toUpperCase()}} 
h4(class=mobile?'item item-divider':'')=env.t('attributes')
table.table.table-striped
each statInfo, stat in { str: {title:"strength",popover:'strengthText'},int: {title:"intelligence",popover:'intText'},con: {title:"constitution",popover:'conText'},per: {title:"perception",popover:'perText'} }
tr
td
span.hint(popover-title=env.t(statInfo.title), popover-placement='right',
popover=env.t(statInfo.popover), popover-trigger='mouseenter')
strong=env.t(statInfo.title)
strong : {{profile._statsComputed.#{stat}}}
td: ul.list-unstyled
+statList('statCalc.levelBonus(profile.stats.lvl)', 'levelBonus', 'level', true)
+statList('statCalc.equipmentStatBonus("' + stat + '", profile.items.gear.equipped)', 'equipmentBonus', 'equipment', true)
+statList('statCalc.classBonus(profile, "' + stat + '")', 'classBonus', 'classEquipBonus')
+statList('profile.stats.' + stat, 'allocatedPoints', 'allocated')
+statList('profile.stats.buffs.' + stat, 'buffs', 'buffs', true)
tr(ng-if='profile.stats.buffs.stealth')
td(colspan='2')
strong.hint(popover-title=env.t('stealth'), popover-trigger='mouseenter',
popover-placement='right', popover=env.t('stealthNewDay'))
=env.t('stealth')
strong : {{profile.stats.buffs.stealth}} 
tr(ng-if='profile.stats.buffs.streaks')
td(colspan='2')
strong.hint(popover-title=env.t('streaksFrozen'), popover-trigger='mouseenter',
popover-placement='right', popover=env.t('streaksFrozenText'))
=env.t('streaksFrozen')
h4(class=mobile?'item item-divider':'',ng-if='user.flags.dropsEnabled')=env.t('pets')
table.table.table-striped(ng-if='user.flags.dropsEnabled')
+basicRow('petsFound','{{_.size(profile.items.pets)}}')
+basicRow('beastMasterProgress','{{profile.petCount}}/90')
h4(class=mobile?'item item-divider':'', ng-if='user.flags.dropsEnabled')=env.t('mounts')
table.table.table-striped(ng-if='user.flags.dropsEnabled')
+basicRow('mountsTamed','{{_.size(profile.items.mounts)}}')
+basicRow('mountMasterProgress','{{profile.mountCount}}/90')