extend player

block playercontent
  .row        
    .col-md-12        
      h3 Teammates (Players)
      table.table#teammates
        thead
          tr
            th Name
            th Games
            th Wins
            th Winrate          
        each teammate in player.teammates
          if (teammate.account_id !== constants.anonymous_account_id && teammate.account_id !== player.account_id && teammate.games > 2) 
            tr
              td
                img.user(src=teammate.avatar)
                a(href='/players/#{teammate.account_id}')=teammate.personaname || teammate.account_id
              td= teammate.games
              td= teammate.win
              td #{(100*teammate.win/teammate.games).toFixed(2)}%
  .row
    .col-md-12
      include ads/leaderboard_2
  .row
    .col-md-6
      h3 Teammates (Heroes)
      table.table#together
        thead
          tr
            th Hero
            th Hero Name
            th Games
            th Wins
            th Winrate
        each hero in constants.heroes
          tr
            td.hero
              img(src=hero.img, title=hero.localized_name)
            td=hero.localized_name
            - var t = player.together[hero.id]
            td #{t ? t.games : 0}
            td #{t ? t.win : 0}
            td #{t ? (100*t.win/t.games).toFixed(2) : 0.00}%
    .col-md-6
      h3 Enemies (Heroes)
      table.table#against
        thead
          tr
            th Hero
            th Hero Name
            th Games
            th Wins
            th Winrate
        each hero in constants.heroes
          tr
            td.hero
              img(src=hero.img, title=hero.localized_name)
            td=hero.localized_name
            - var a = player.against[hero.id]
            td #{a ? a.games : 0}
            td #{a ? a.win : 0}
            td #{a ? (100*a.win/a.games).toFixed(2) : 0.00}%  
  .row
    .col-md-12
      include ads/leaderboard_3
  .row
    .col-md-12
      h3 Match Durations
      script.
        var durations = !{JSON.stringify(player.durations)}
      #chart-duration