diff --git a/website/views/shared/profiles/stats.jade b/website/views/shared/profiles/stats.jade index 7a7f2a737b..c82674f731 100644 --- a/website/views/shared/profiles/stats.jade +++ b/website/views/shared/profiles/stats.jade @@ -12,60 +12,7 @@ mixin statList(calculatedStat, popover, text, useOneTimeBinding) =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') +include ./stats/basic-stats +include ./stats/equipment +include ./stats/attributes +include ./stats/pets-and-mounts diff --git a/website/views/shared/profiles/stats/attributes.jade b/website/views/shared/profiles/stats/attributes.jade new file mode 100644 index 0000000000..0d222a42b4 --- /dev/null +++ b/website/views/shared/profiles/stats/attributes.jade @@ -0,0 +1,29 @@ +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') diff --git a/website/views/shared/profiles/stats/basic-stats.jade b/website/views/shared/profiles/stats/basic-stats.jade new file mode 100644 index 0000000000..694e7408fb --- /dev/null +++ b/website/views/shared/profiles/stats/basic-stats.jade @@ -0,0 +1,7 @@ +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)}}') diff --git a/website/views/shared/profiles/stats/equipment.jade b/website/views/shared/profiles/stats/equipment.jade new file mode 100644 index 0000000000..69e4edee5b --- /dev/null +++ b/website/views/shared/profiles/stats/equipment.jade @@ -0,0 +1,9 @@ +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()}}  diff --git a/website/views/shared/profiles/stats/pets-and-mounts.jade b/website/views/shared/profiles/stats/pets-and-mounts.jade new file mode 100644 index 0000000000..f3bb0bef25 --- /dev/null +++ b/website/views/shared/profiles/stats/pets-and-mounts.jade @@ -0,0 +1,12 @@ +div(ng-if='user.flags.dropsEnabled') + h4(class=mobile?'item item-divider':'')=env.t('pets') + + table.table.table-striped + +basicRow('petsFound','{{_.size(profile.items.pets)}}') + +basicRow('beastMasterProgress','{{profile.petCount}}/90') + + h4(class=mobile?'item item-divider':'')=env.t('mounts') + + table.table.table-striped + +basicRow('mountsTamed','{{_.size(profile.items.mounts)}}') + +basicRow('mountMasterProgress','{{profile.mountCount}}/90')