h4=env.t('stats')
table.table.table-striped
  tr
    td
      strong=env.t('health')
      | : {{profile.stats.hp | number:0}} / 50
  tr
    td
      strong=env.t('gold')
      | : {{profile.stats.gp | number:0}}
  tr
    td
      strong=env.t('level')
      | : {{profile.stats.lvl}}
  tr
    td
      strong=env.t('experience')
      | : {{profile.stats.exp | number:0}} / {{Shared.tnl(profile.stats.lvl)}}

h4.stats-equipment(ng-show='user.flags.itemsEnabled')=env.t('equipment')
table.table.table-striped(ng-show='user.flags.itemsEnabled')
  // FIXME this isn't refreshing properly. On first party modal, correct. Second party modal click gives the previous gear. It's always one behind.
  tr(ng-repeat='(k,v) in profile.items.gear.equipped', ng-init='piece=Content.gear.flat[v]', ng-show='piece')
    td
      strong {{piece.text}}:&nbsp;
      span(ng-repeat='stat in ["str","con","per","int"]', ng-show='piece[stat]') {{piece[stat]}} {{stat.toUpperCase()}}&nbsp;

h4=env.t('attributes')
table.table.table-striped
  tr(ng-repeat='(k,v) in {str:"Strength (STR)",int:"Intelligence (INT)",con:"Constitution (CON)",per:"Perception (PER)"}')
    td
      span.hint(ng-if='k=="str"', popover-title=env.t('strength'), popover-placement='right', popover=env.t('strengthText'), popover-trigger='mouseenter', style='margin-right:3px')
        strong {{v}}
      span.hint(ng-if='k=="con"', popover-title=env.t('constitution'), popover-placement='right', popover=env.t('conText') popover-trigger='mouseenter', style='margin-right:3px')
        strong {{v}}
      span.hint(ng-if='k=="per"', popover-title=env.t('perception'), popover-placement='right', popover=env.t('perText'), popover-trigger='mouseenter', style='margin-right:3px')
        strong {{v}}
      span.hint(ng-if='k=="int"', popover-title=env.t('intelligence'), popover-placement='right', popover=env.t('intText'), popover-trigger='mouseenter', style='margin-right:3px')
        strong {{v}}
      span
        strong : {{profile._statsComputed[k]}}
    td
      ul.list-unstyled
        li(ng-show='profile.stats.lvl > 1')
          span.hint(popover-title=env.t('levelBonus'), popover-trigger='mouseenter', popover-placement='top', popover=env.t('levelBonusText'))=env.t('level')
          |: {{(profile.stats.lvl - 1) / 2}}&nbsp;
        li(ng-show='Content.gear.flat[profile.items.gear.equipped.weapon][k] + Content.gear.flat[profile.items.gear.equipped.armor][k] + Content.gear.flat[profile.items.gear.equipped.head][k] + Content.gear.flat[profile.items.gear.equipped.shield][k] > 0')
          span.hint(popover-title=env.t('equipment'), popover-trigger='mouseenter', popover-placement='top', popover=env.t('equipmentBonusText'))=env.t('equipment')
          |: {{Content.gear.flat[profile.items.gear.equipped.weapon][k] + Content.gear.flat[profile.items.gear.equipped.armor][k] + Content.gear.flat[profile.items.gear.equipped.head][k] + Content.gear.flat[profile.items.gear.equipped.shield][k] || 0}}&nbsp;
        li(ng-show='profile._statsComputed[k] - profile.stats.buffs[k] - ((profile.stats.lvl - 1) / 2) - Content.gear.flat[profile.items.gear.equipped.weapon][k] - Content.gear.flat[profile.items.gear.equipped.armor][k] - Content.gear.flat[profile.items.gear.equipped.head][k] - Content.gear.flat[profile.items.gear.equipped.shield][k] - profile.stats[k] > 0')
          span.hint(popover-title=env.t('classBonus'), popover-trigger='mouseenter', popover-placement='top', popover=env.t('classBonusText'))=env.t('classEquipBonus')
          |: {{profile._statsComputed[k] - profile.stats.buffs[k] - ((profile.stats.lvl - 1) / 2) - Content.gear.flat[profile.items.gear.equipped.weapon][k] - Content.gear.flat[profile.items.gear.equipped.armor][k] - Content.gear.flat[profile.items.gear.equipped.head][k] - Content.gear.flat[profile.items.gear.equipped.shield][k] - profile.stats[k]}}&nbsp;
        li(ng-show='profile.stats[k] > 0')
          span.hint(popover-title=env.t('allocatedPoints'), popover-trigger='mouseenter', popover-placement='top', popover=env.t('allocatedPointsText'))=env.t('allocated')
          |: {{profile.stats[k] || 0}}&nbsp;
        li(ng-show='profile.stats.buffs[k] > 0')
          span.hint(popover-title=env.t('buffs'), popover-trigger='mouseenter', popover-placement='top', popover=env.t('buffsText'))=env.t('buffs')
          |: {{profile.stats.buffs[k] || 0}}&nbsp;
  tr(ng-if='profile.stats.buffs.stealth')
    td
      span.hint(popover-title=env.t('stealth'), popover-trigger='mouseenter', popover-placement='right', popover=env.t('stealthNewDay'))
        strong 
          =env.t('stealth')
      strong : {{profile.stats.buffs.stealth}}&nbsp;
    td
  tr(ng-if='profile.stats.buffs.streaks')
    td
      strong.hint(popover-title=env.t('streaksFrozen'), popover-trigger='mouseenter', popover-placement='right', popover=env.t('streaksFrozenText'))=env.t('streaksFrozen')
    td

h4(ng-show='user.flags.dropsEnabled')=env.t('pets')
table.table.table-striped(ng-show='user.flags.dropsEnabled')
  tr
    td
      strong=env.t('petsFound')
      | : {{profile.petCount}}
// Dunno why this doesn't work //
// tr
    td
      strong=env.t('mountsTamed')
      | : {{profile.mountCount}} //
