include ./quest-rewards

script(type='text/ng-template', id='modals/questCompleted.html')  
  .modal-header
    h4 "{{::Content.quests[user.party.quest.completed].text()}}"
      =env.t('completed')
  .modal-body
    .col-centered(ng-class='::Content.quests[user.party.quest.completed].completion() ? "pull-right-sm" : ""', class='quest_{{user.party.quest.completed}}')
    p(ng-bind-html='::Content.quests[user.party.quest.completed].completion()')
    quest-rewards(key='{{user.party.quest.completed}}', header=env.t('youReceived'))
  .modal-footer
    button.btn.btn-primary(ng-click='set({"party.quest.completed":""}); $close()')=env.t('ok')

script(type='text/ng-template', id='modals/showQuest.html')  
  .modal-header
    h4 {{::selectedQuest.text()}}
  .modal-body
    .pull-right-sm.text-center
      .col-centered(class='quest_{{::selectedQuest.key}}')
      div(ng-if='::selectedQuest.boss')
        h4 {{::selectedQuest.boss.name()}}
        p
          strong=env.t('bossHP') + ': ' 
          | {{::selectedQuest.boss.hp}}
        p
          strong=env.t('bossStrength') + ': '
          | {{::selectedQuest.boss.str}}
      div(ng-if='::selectedQuest.collect')
        p(ng-repeat='(k,v) in ::selectedQuest.collect')
          strong=env.t('collect') + ': '
          | {{::selectedQuest.collect[k].count}} {{::selectedQuest.collect[k].text()}} 

    div(ng-bind-html='::selectedQuest.notes()')
    quest-rewards(key='{{::selectedQuest.key}}', header=env.t('rewards'))
    hr    
    .npc_ian.pull-left
    p=env.t('questSend')
    p=env.t('questWarning')
  .modal-footer
    button.btn.btn-default(ng-click='closeQuest(); $close()')=env.t('cancel')
    button.btn.btn-primary(ng-click='questInit(); $close()')=env.t('inviteParty')

script(type='text/ng-template', id='modals/buyQuest.html')  
  .modal-header
    h4 {{::selectedQuest.text()}}
  .modal-body
    .pull-right-sm.text-center
      .col-centered(class='quest_{{::selectedQuest.key}}')
      div(ng-if='::selectedQuest.boss')
        h4 {{::selectedQuest.boss.name()}}
        p
          strong=env.t('bossHP') + ': ' 
          | {{::selectedQuest.boss.hp}}
        p
          strong=env.t('bossStrength') + ': '
          | {{::selectedQuest.boss.str}}
      div(ng-if='::selectedQuest.collect')
        p(ng-repeat='(k,v) in ::selectedQuest.collect')
          strong=env.t('collect') + ': '
          | {{::selectedQuest.collect[k].count}} {{::selectedQuest.collect[k].text()}} 
    div(ng-bind-html='::selectedQuest.notes()')
    quest-rewards(key='{{::selectedQuest.key}}', header=env.t('rewards'))
  .modal-footer
    button.btn.btn-default(ng-click='closeQuest(); $close()')=env.t('neverMind')
    button.btn.btn-primary(ng-click='purchase("quests", quest); closeQuest(); $close()')=env.t('buyQuest')

script(type='text/ng-template', id='modals/questInvitation.html')  
  .modal-header
    h4=env.t('questInvitation')
      |&nbsp;{{::Content.quests[party.quest.key].text()}}
  .modal-body
    .pull-right-sm.text-center
      .col-centered(class='quest_{{::Content.quests[party.quest.key].key}}')
      div(ng-if='::Content.quests[party.quest.key].boss')
        h4 {{::Content.quests[party.quest.key].boss.name()}}
        p
          strong=env.t('bossHP') + ': ' 
          | {{::Content.quests[party.quest.key].boss.hp}}
        p
          strong=env.t('bossStrength') + ': '
          | {{::Content.quests[party.quest.key].boss.str}}
      div(ng-if='::Content.quests[party.quest.key].collect')
        p(ng-repeat='(k,v) in ::Content.quests[party.quest.key].collect')
          strong=env.t('collect') + ': '
          | {{::Content.quests[party.quest.key].collect[k].count}} {{::Content.quests[party.quest.key].collect[k].text()}} 
    div(ng-bind-html='::Content.quests[party.quest.key].notes()')
    quest-rewards(key='{{::party.quest.key}}', header=env.t('rewards'))
  .modal-footer
    button.btn.btn-default(ng-click='questHold = true; $close()')=env.t('askLater')
    button.btn.btn-default(ng-click='party.$questReject(); $close()')=env.t('reject')
    button.btn.btn-primary(ng-click='party.$questAccept(); $close()')=env.t('accept')
