include ../avatar/generated_avatar
mixin achievementFooter
  - var tweet = env.t('achievementShare');
  .modal-footer(style='margin-top:0', ng-init='loadWidgets()')
    .container-fluid
      .row.text-center
        .col-xs-4
          a.twitter-share-button(href='https://twitter.com/intent/tweet?text=#{tweet}&via=habitica&url=#{env.BASE_URL}/social/achievement&count=none')=env.t('tweet')
        .col-xs-4
          .fb-share-button(data-href='#{env.BASE_URL}/social/achievement', data-layout='button')
        .col-xs-4
          a.tumblr-share-button(data-href='#{env.BASE_URL}/social/achievement', data-notes='none')

mixin achievementAvatar(badge,margin)
  .container-fluid
    .row
      .col-xs-4(style='padding:0')
        div(class='achievement-#{badge}2x' style='margin: 2em auto')
      .col-xs-4(style='padding:0')
        .herobox(style='padding:0; width:0; height:7em; margin:auto #{margin}em')
          .character-sprites(style='width:0')
            +generatedAvatar
      .col-xs-4(style='padding:0')
        div(class='achievement-#{badge}2x' style='margin: 2em auto')

// Streak
script(id='modals/achievements/streak.html', type='text/ng-template')
  .modal-content(style='min-width:28em')
    .modal-body.text-center
      h3(style='margin-bottom: 0')=env.t('streakAchievement')
      +achievementAvatar('thermometer',2.5)
      h4(ng-if='user.achievements.streak === 1')=env.t('firstStreakAchievement')
      h4(ng-if='user.achievements.streak > 1')=env.t('streakAchievementCount', {streaks:'{{::user.achievements.streak}}'})
      p=env.t('twentyOneDays')
      p=env.t('dontBreakStreak')
      br
      button.btn.btn-primary(ng-click='$close()')=env.t('dontStop')
      .checkbox
        label(style='display:inline-block')=env.t('dontShowAgain')
          input(type='checkbox', ng-model='user.preferences.suppressModals.streak', ng-change='set({"preferences.suppressModals.streak": user.preferences.suppressModals.streak?true: false})')
    +achievementFooter

// Max Gear
script(id='modals/achievements/ultimateGear.html', type='text/ng-template')
  .modal-content(style='min-width:28em')
    .modal-body.text-center
      h3(style='margin-bottom:0')=env.t('modalAchievement')
      +achievementAvatar('armor',2.5)
      p=env.t('gearAchievement')
      br
      table.multi-achievement
        tr
          td(ng-if='::user.achievements.ultimateGearSets.healer').multi-achievement
            .achievement-ultimate-healer2x.multi-achievement
            =env.t('healer')
          td(ng-if='::user.achievements.ultimateGearSets.wizard').multi-achievement
            .achievement-ultimate-mage2x.multi-achievement
            =env.t('mage')
          td(ng-if='::user.achievements.ultimateGearSets.rogue').multi-achievement
            .achievement-ultimate-rogue2x.multi-achievement
            =env.t('rogue')
          td(ng-if='::user.achievements.ultimateGearSets.warrior').multi-achievement
            .achievement-ultimate-warrior2x.multi-achievement
            =env.t('warrior')
      br
      div(ng-if='!(user.achievements.ultimateGearSets.healer && user.achievements.ultimateGearSets.wizard && user.achievements.ultimateGearSets.rogue && user.achievements.ultimateGearSets.warrior)')
        p!=env.t('moreGearAchievements')
        br
      .shop_armoire.pull-right
      p!=env.t("armoireUnlocked")
      br
      button.btn.btn-primary(ng-click='$close()')=env.t('huzzah')
    +achievementFooter

// Beast Master
script(id='modals/achievements/beastMaster.html', type='text/ng-template')
  .modal-content(style='min-width:28em')
    .modal-body.text-center
      h3(style='margin-bottom:0')=env.t('modalAchievement')
      +achievementAvatar('rat',0)
      p=env.t('beastAchievement')
      br
      button.btn.btn-primary(ng-click='$close()')=env.t('huzzah')
    +achievementFooter

// Mount Master
script(id='modals/achievements/mountMaster.html', type='text/ng-template')
  .modal-content(style='min-width:28em')
    .modal-body.text-center
      h3(style='margin-bottom:0')=env.t('modalAchievement')
      +achievementAvatar('wolf',0)
      p=env.t('mountAchievement')
      br
      button.btn.btn-primary(ng-click='$close()')=env.t('huzzah')
    +achievementFooter

// Triad Bingo
script(id='modals/achievements/triadBingo.html', type='text/ng-template')
  .modal-content(style='min-width:28em')
    .modal-body.text-center
      h3(style='margin-bottom:0')=env.t('modalAchievement')
      +achievementAvatar('triadbingo',0)
      p=env.t('triadBingoAchievement')
      br
      button.btn.btn-primary(ng-click='$close()')=env.t('huzzah')
    +achievementFooter

// Contributor
script(id='modals/achievements/contributor.html', type='text/ng-template')
  .modal-content(style='min-width:28em')
    .modal-body.text-center
      h3(style='margin-bottom:0')=env.t('modalContribAchievement')
      +achievementAvatar('boot',0)
      !=env.t('contribModal', {name: "{{user.profile.name}}", level: "{{user.contributor.level}}"}) + ' '
      a(href='http://habitica.wikia.com/wiki/Contributor_Rewards' target='_blank')=env.t('contribLink')
      br
      button.btn.btn-primary(style='margin-top:1em' ng-click='$close()')=env.t('huzzah')
    +achievementFooter

//Rebirth
script(id='modals/achievements/rebirth.html', type='text/ng-template')
  .modal-content(style='min-width:28em')
    .modal-body.text-center
      h3(style='margin-bottom:0')=env.t('modalAchievement')
      +achievementAvatar('sun',0)
      div(ng-if='user.achievements.rebirthLevel < 100')
        =env.t('rebirthAchievement', {number: "{{user.achievements.rebirths}}", level: "{{user.achievements.rebirthLevel}}"})
      div(ng-if='user.achievements.rebirthLevel >= 100')
        =env.t('rebirthAchievement100', {number: "{{user.achievements.rebirths}}"})
      br
      button.btn.btn-primary(ng-click='$close()')=env.t('huzzah')
    +achievementFooter

// Party Up
script(id='modals/achievements/partyUp.html', type='text/ng-template')
  .modal-content(style='min-width:28em')
    .modal-body.text-center
      h3(style='margin-bottom:0')=env.t('modalAchievement')
      +achievementAvatar('partyUp',0)
      p=env.t('partyUpAchievement')
      br
      button.btn.btn-primary(ng-click='$close()')=env.t('huzzah')
    +achievementFooter

// Party On
script(id='modals/achievements/partyOn.html', type='text/ng-template')
  .modal-content(style='min-width:28em')
    .modal-body.text-center
      h3(style='margin-bottom:0')=env.t('modalAchievement')
      +achievementAvatar('partyOn',0)
      p=env.t('partyOnAchievement')
      br
      button.btn.btn-primary(ng-click='$close()')=env.t('huzzah')
    +achievementFooter
