include ../avatar/generated_avatar

script(type='text/ng-template', id='modals/wonChallenge.html')
  - var tweet = env.t('wonChallengeShare');
  .modal-content(style='min-width:28em')
    .modal-body.text-center
      h3(style='margin-bottom: 0')=env.t('wonChallenge')
      h4: markdown(text='::user.achievements.challenges[user.achievements.challenges.length - 1]')
      .container-fluid
        .row(style='margin-bottom:1em', ng-controller='UserCtrl')
          .col-xs-4(style='padding:0')
            .container-fluid
              .row
                .col-xs-4(style='padding:0')
                .col-xs-4(style='padding:0')
                  .achievement-karaoke-2x(style='margin-top: 2em')
          .col-xs-4(style='padding:0')
            .herobox(style='padding:0; width:0; height:7em')
              .character-sprites(style='width:0')
                +generatedAvatar
          .col-xs-4(style='padding:0')
            .container-fluid
              .row
                .col-xs-4(style='padding:0')
                .col-xs-4(style='padding:0')
                  .achievement-karaoke-2x(style='margin-top: 2em')
      p=env.t('congratulations')
      br
      button.btn.btn-primary(ng-click='$close()')=env.t('hurray')
    .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/won-challenge&count=none')=env.t('tweet')
          .col-xs-4(style='margin-left:.8em')
            .fb-share-button(data-href='#{env.BASE_URL}/social/won-challenge', data-layout='button')
          .col-xs-4(style='margin-left:.8em')
            a.tumblr-share-button(data-href='#{env.BASE_URL}/social/won-challenge', data-notes='none')
