if mobile
  .item.item-divider=env.t('achievements')

div(ng-if='::profile.achievements.habitSurveys || user._id == profile._id')
  .achievement.achievement-tree(ng-if='::profile.achievements.habitSurveys')
  div(ng-class='::{muted: !profile.achievements.habitSurveys}')
    h5=env.t('helped')
    small(ng-if='::profile.achievements.habitSurveys > 1')
      =env.t('surveysMultiple', {surveys: "{{::profile.achievements.habitSurveys}}"})
    small(ng-if='::!(profile.achievements.habitSurveys > 1)')
      =env.t('surveysSingle')
  hr

div(ng-if='::profile.backer.npc')
  .achievement.achievement-helm
  h5
    span.label.label-npc
      | {{::profile.backer.npc}}
      =env.t('npc')
  small=env.t('npcText')
  hr

div(ng-if='::profile.contributor.level || user._id == profile._id')
  .achievement.achievement-boot(ng-if='::profile.contributor.level')
  div(ng-class='::{muted: !profile.contributor.level}')
    h5
      span.label.label-default(ng-if='::profile.contributor.level', class='label-contributor-{{::profile.contributor.level}}') {{::contribText(profile.contributor, profile.backer)}}
      span.label.label-default(ng-if='::!profile.contributor.level')=env.t('contribName')
    small
      =env.t('contribText')
      |&nbsp;
      +aLink('http://habitica.wikia.com/wiki/Contributing_to_Habitica', env.t('readMore'))
      | .
  hr

div(ng-if='::profile.backer.tier')
  .achievement.achievement-heart
  h5=env.t('kickstartName', {tier: "{{::profile.backer.tier}}"})
  small=env.t('kickstartText')
  hr

div(ng-if='::profile.achievements.streak || user._id == profile._id')
  .achievement.achievement-thermometer(ng-if='::profile.achievements.streak')
  div(ng-class='::{muted: !profile.achievements.streak}')
    h5(ng-if='::profile.achievements.streak > 1 || !profile.achievements.streak')

      | {{::profile.achievements.streak || 0 }}&nbsp;
      =env.t('streakName')
    small(ng-if='::profile.achievements.streak > 1 || !profile.achievements.streak')=env.t('streakText', {streaks: "{{::profile.achievements.streak || 0 }}"})
    h5(ng-if='::profile.achievements.streak == 1')
      =env.t('streakSingular')
    small(ng-if='::profile.achievements.streak == 1')=env.t('streakSingularText')
  hr

div(ng-if='::profile.achievements.perfect || user._id == profile._id')
  .achievement.achievement-perfect(ng-if='::profile.achievements.perfect')
  div(ng-class='::{muted: !profile.achievements.perfect}')
    h5(ng-if='::profile.achievements.perfect > 1 || !profile.achievements.perfect')

      | {{::profile.achievements.perfect || 0 }}&nbsp;
      =env.t('perfectName')
    small(ng-if='::profile.achievements.perfect > 1 || !profile.achievements.perfect')=env.t('perfectText', {perfects: "{{::profile.achievements.perfect || 0 }}"})
    h5(ng-if='::profile.achievements.perfect == 1')
      =env.t('perfectSingular')
    small(ng-if='::profile.achievements.perfect == 1')=env.t('perfectSingularText')
  hr

- var ultimateGearCheck = 'profile.achievements.ultimateGearSets.healer || profile.achievements.ultimateGearSets.wizard || profile.achievements.ultimateGearSets.rogue || profile.achievements.ultimateGearSets.warrior'
div(ng-if='(user._id == profile._id) || #{ultimateGearCheck}')
  .achievement.achievement-armor(ng-if='#{ultimateGearCheck}')
  div(ng-class='::{muted: !(#{ultimateGearCheck})}')
    h5=env.t('ultimGearName')
    small=env.t('ultimGearText')
    table.multi-achievement
      tr
        td(ng-if='::profile.achievements.ultimateGearSets.healer').multi-achievement
          .achievement-ultimate-healer.multi-achievement
          =env.t('healer')
        td(ng-if='::profile.achievements.ultimateGearSets.wizard').multi-achievement
          .achievement-ultimate-mage.multi-achievement
          =env.t('mage')
        td(ng-if='::profile.achievements.ultimateGearSets.rogue').multi-achievement
          .achievement-ultimate-rogue.multi-achievement
          =env.t('rogue')
        td(ng-if='::profile.achievements.ultimateGearSets.warrior').multi-achievement
          .achievement-ultimate-warrior.multi-achievement
          =env.t('warrior')
  hr

div(ng-if='::profile.achievements.partyUp || user._id == profile._id')
  .achievement.achievement-partyUp(ng-if='::profile.achievements.partyUp')
  div(ng-class='::{muted: !profile.achievements.partyUp}')
    h5=env.t('partyUpName')
    small=env.t('partyUpAchievement')
  hr

div(ng-if='::profile.achievements.partyOn || user._id == profile._id')
  .achievement.achievement-partyOn(ng-if='::profile.achievements.partyOn')
  div(ng-class='::{muted: !profile.achievements.partyOn}')
    h5=env.t('partyOnName')
    small=env.t('partyOnAchievement')
  hr

div(ng-if='::profile.achievements.beastMaster || user._id == profile._id')
  .achievement.achievement-rat(ng-if='::profile.achievements.beastMaster')
  div(ng-class='::{muted: !profile.achievements.beastMaster}')
    h5=env.t('beastMasterName')
    small=env.t('beastMasterText')
    small(ng-if='::profile.achievements.beastMasterCount')
      =env.t('beastMasterText2', {count: "{{::profile.achievements.beastMasterCount}}"})
  hr

div(ng-if='::profile.achievements.mountMaster || user._id == profile._id')
  .achievement.achievement-wolf(ng-if='::profile.achievements.mountMaster')
  div(ng-class='::{muted: !profile.achievements.mountMaster}')
    h5=env.t('mountMasterName')
    small=env.t('mountMasterText')
    small(ng-if='::profile.achievements.mountMasterCount')
      =env.t('mountMasterText2', {count: "{{::profile.achievements.mountMasterCount}}"})
  hr

div(ng-if='::profile.achievements.triadBingo || user._id == profile._id')
  .achievement.achievement-triadbingo(ng-if='::profile.achievements.triadBingo')
  div(ng-class='::{muted: !profile.achievements.triadBingo}')
    h5=env.t('triadBingoName')

    small=env.t('triadBingoText')
    small(ng-if='::profile.achievements.triadBingoCount')
      =env.t('triadBingoText2', {count: "{{::profile.achievements.triadBingoCount}}"})
  hr

div(ng-if='::profile.achievements.rebirths')
  .achievement.achievement-sun
  h5(ng-if='::profile.achievements.rebirths == 1')=env.t('rebirthBegan')
  h5(ng-if='::profile.achievements.rebirths > 1')
    =env.t('rebirthText', {rebirths: "{{::profile.achievements.rebirths}}"})
  small(ng-if='::profile.achievements.rebirthLevel < 100')
    =env.t('rebirthOrb')
    |&nbsp;{{::profile.achievements.rebirthLevel}}.
  small(ng-if='::profile.achievements.rebirthLevel >= 100')
    =env.t('rebirthOrb100')

  hr

div(ng-if='::profile.achievements.veteran')
  .achievement.achievement-cake
  div(ng-if='::profile.achievements.veteran')
    h5=env.t('veteran')
    small=env.t('veteranText')
  hr

div(ng-if='::profile.achievements.originalUser')
  .achievement.achievement-alpha
  div(ng-if='::profile.achievements.originalUser')
    h5=env.t('originalUser')
    small!=env.t('originalUserText')
  hr

div(ng-if='::profile.achievements.challenges.length || user._id == profile._id')
  // This is a very strange icon to use. revisit
  .achievement.achievement-karaoke(ng-if='::profile.achievements.challenges.length')
  div(ng-class='::{muted: !profile.achievements.challenges.length}')
    h5=env.t('challengeWinner')
    table.table.table-striped
      tr(ng-repeat='chal in profile.achievements.challenges track by $index')
        td: markdown(text='::chal')
  hr

div(ng-if='::profile.achievements.quests || user._id == profile._id')
  .achievement.achievement-alien(ng-if='::profile.achievements.quests')
  div(ng-class='::{muted: !profile.achievements.quests}')
    h5=env.t('completedQuests')
    table.table.table-striped
      tr(ng-repeat='(k,v) in profile.achievements.quests')
        td {{::Content.quests[k].text()}}
        td x{{::v}}
  hr

div(ng-if='::profile.achievements.snowball')
  .achievement.achievement-snowball
  h5=env.t('annoyingFriends')
  small
    =env.t('annoyingFriendsText', {snowballs: "{{::profile.achievements.snowball}}"})
  hr

div(ng-if='::profile.achievements.spookySparkles')
  .achievement.achievement-spookySparkles
  h5=env.t('alarmingFriends')
  small
    =env.t('alarmingFriendsText', {spookySparkles: "{{::profile.achievements.spookySparkles}}"})
  hr

div(ng-if='::profile.achievements.shinySeed')
  .achievement.achievement-shinySeed
  h5=env.t('agriculturalFriends')
  small
    =env.t('agriculturalFriendsText', {seeds: "{{::profile.achievements.shinySeed}}"})
  hr

div(ng-if='::profile.achievements.seafoam')
  .achievement.achievement-seafoam
  h5=env.t('aquaticFriends')
  small
    =env.t('aquaticFriendsText', {seafoam: "{{::profile.achievements.seafoam}}"})
  hr

div(ng-if='::profile.achievements.habiticaDays')
  .achievement.achievement-habiticaDay
  h5=env.t('habiticaDay')
  small(ng-if='::profile.achievements.habiticaDays == 1')
    =env.t('habiticaDaySingularText')
  small(ng-if='::profile.achievements.habiticaDays > 1')
    =env.t('habiticaDayPluralText', {number: "{{::profile.achievements.habiticaDays}}"})
  hr

div(ng-if='::profile.achievements.habitBirthdays')
  .achievement.achievement-habitBirthday
  h5=env.t('habitBirthday')
  small(ng-if='::profile.achievements.habitBirthdays == 1')
    =env.t('habitBirthdayText')
  small(ng-if='::profile.achievements.habitBirthdays > 1')
    =env.t('habitBirthdayPluralText', {number: "{{::profile.achievements.habitBirthdays}}"})
  hr

div(ng-if='::profile.achievements.quests.dilatory')
  .achievement.achievement-dilatory
  h5=env.t('achievementDilatory')
  small
    =env.t('achievementDilatoryText')
  hr

div(ng-if='::profile.achievements.quests.stressbeast')
  .achievement.achievement-stoikalm
  h5=env.t('achievementStressbeast')
  small
    =env.t('achievementStressbeastText')
  hr

div(ng-if='::profile.achievements.quests.burnout')
  .achievement.achievement-burnout
  h5=env.t('achievementBurnout')
  small
    =env.t('achievementBurnoutText')
  hr

div(ng-if='::profile.achievements.quests.bewilder')
  .achievement.achievement-bewilder
  h5=env.t('achievementBewilder')
  small
    =env.t('achievementBewilderText')
  hr

div(ng-if='::profile.achievements.costumeContests')
  .achievement.achievement-costumeContest
  h5=env.t('costumeContest')
  small(ng-if='::profile.achievements.costumeContests === 1')
    !=env.t('costumeContestText')
  small(ng-if='::profile.achievements.costumeContests > 1')
    !=env.t('costumeContestTextPlural', {number: "{{::profile.achievements.costumeContests}}"})
  hr

each card in ['greeting', 'thankyou', 'nye', 'valentine', 'birthday']
  div(ng-if='::profile.achievements.#{card}')
    div(class='achievement achievement-#{card}')
    h5=env.t(card + 'CardAchievementTitle')
    small=env.t(card + 'CardAchievementText', {cards: "{{::profile.achievements." + card + "}}"})
    hr
