include ../avatar/generated_avatar

script(type='text/ng-template', id='modals/levelUp.html')
  - var tweet = env.t('levelUpShare');
  .modal-content(style='min-width:28em')
    .modal-body.text-center(style='padding-bottom:0')
      h3(style='margin-bottom: 0')=env.t('gainedLevel')
      .container-fluid
        .row
          .herobox(style='margin:auto 8.3em; width: 6em; height: 9em; padding-top: 0; cursor:default')
            .character-sprites(style='margin: 0; width: 0')
              +generatedAvatar
        .row
          .herobox(style='margin:auto 8.9em; width: 6em; height: 0; padding-top: 0; cursor:default')
            .avatar-level(ng-class='userLevelStyle(user)')=env.t('level')+' {{user.stats.lvl}}'
      h4(style='margin-top: 1em')!=env.t('leveledUp', {level:'{{user.stats.lvl}}'})
      p=env.t('fullyHealed')
      br
      div(ng-if='user.flags.classSelected && !user.preferences.disableClasses && !user.preferences.automaticAllocation')
        a.btn.btn-default(ng-click='statsAllocationBoxIsOpen = !statsAllocationBoxIsOpen',
          data-toggle='collapse', data-target='#stat-allocation', aria-expanded=false, aria-controls='stat-allocation')
          | {{statsAllocationBoxIsOpen  ? env.t('hideQuickAllocation') : env.t('showQuickAllocation')}}
        p &nbsp;
        .collapse#stat-allocation
          table.table.text-left
            tr
              td
                p(ng-if='::user.stats.lvl >= 100')!=env.t('noMoreAllocate')
                p(ng-if='user.stats.points || user.stats.lvl < 100')
                  strong.inline
                    | {{user.stats.points}}&nbsp;
                  strong.hint(popover-trigger='mouseenter', popover-placement='right', popover=env.t('quickAllocationLevelPopover'))=env.t('unallocated')
              td
            +statAllocation
      button.btn.btn-primary(ng-click='$close()')=env.t('huzzah')
      .checkbox
        label(style='display:inline-block')=env.t('dontShowAgain')
          input(type='checkbox', ng-model='user.preferences.suppressModals.levelUp', ng-change='set({"preferences.suppressModals.levelUp": user.preferences.suppressModals.levelUp?true: false})')
    .modal-footer(style='margin-top:0', ng-init='loadWidgets()')
      .container-fluid
        .row
          .col-xs-3
            a.twitter-share-button(href='https://twitter.com/intent/tweet?text=#{tweet}&via=habitica&url=#{env.BASE_URL}/social/level-up&count=none')=env.t('tweet')
          .col-xs-4(style='margin-left:.8em')
            .fb-share-button(data-href='#{env.BASE_URL}/social/level-up', data-layout='button')
          .col-xs-4(style='margin-left:.8em')
            a.tumblr-share-button(data-href='#{env.BASE_URL}/social/level-up', data-notes='none')
