X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=xonstat%2Ftemplates%2Fplayer_info.mako;h=ad65e8f54324ebdcac39f2a2f9efd24e18760eac;hb=ae2353788574f4d3858d631a932e83b2e1638401;hp=051ca1ebfff0a4cbc371bc098cc772d2b3d80b75;hpb=0115de9b88f8b8aa02bf278d0021c68c8a7e8ce9;p=xonotic%2Fxonstat.git diff --git a/xonstat/templates/player_info.mako b/xonstat/templates/player_info.mako index 051ca1e..ad65e8f 100644 --- a/xonstat/templates/player_info.mako +++ b/xonstat/templates/player_info.mako @@ -1,488 +1,265 @@ <%inherit file="base.mako"/> <%namespace name="nav" file="nav.mako" /> -<%namespace file="accuracy.mako" import="accuracy" /> <%block name="navigation"> -${nav.nav('players')} + ##### Disable the login button until a replacement is implemented. + ${nav.nav('players', False)} <%block name="css"> -${parent.css()} - + ${parent.css()} + + <%block name="js"> -${parent.js()} -% if player is not None: - - - - + + + ##### + -% endif + % endfor + + // weapon accuracy and damage charts + $.getJSON("${request.route_url('player_weaponstats_data_json', id=player.player_id, _query={'limit':20})}", function(data) { + + if(data.games.length < 5) { + d3.select(".row #damageChart").remove(); + d3.select(".row #accuracyChart").remove(); + } + drawDamageChart("#damageChart", data); + drawAccuracyChart("#accuracyChart", data); + }); + <%block name="title"> -Player Information + Player Information - -% if player is None: -

This player is so good we couldn't find him!

-

Seriously though, he probably doesn't exist...just a figment of your imagination. Carry on then!

- -% else:
-
-

${player.nick_html_colors()|n}

+
+

+ ${player.nick_html_colors()|n} + % for medal in medals: + ${medal.alt} + % endfor +

+ +
+ Joined ${player.fuzzy_date()} (player #${player.player_id}) + % if cake_day: + + % endif +
+##### TABS #####
-
-
+
+
    % for g in games_played: -
    -
    -

    - % if g.game_type_cd in overall_stats: - Last Played: ${overall_stats[g.game_type_cd].last_played_fuzzy}
    - % endif - - Games Played: ${g.games}
    - - Playing Time: ${overall_stats[g.game_type_cd].total_playing_time}
    - - % if g.game_type_cd in fav_maps: - Favorite Map: ${fav_maps[g.game_type_cd].map_name}
    - % endif -

    -
    -
    -

    - Win Percentage: ${round(g.win_pct,2)}% (${g.wins} wins, ${g.losses} losses)
    - - % if g.game_type_cd in overall_stats: - % if overall_stats[g.game_type_cd].k_d_ratio is not None: - Kill Ratio: ${round(overall_stats[g.game_type_cd].k_d_ratio,2)} (${overall_stats[g.game_type_cd].total_kills} kills, ${overall_stats[g.game_type_cd].total_deaths} deaths)
    - % endif - % endif - - % if g.game_type_cd in elos: +

  • -
  • +
    + % for g in games_played: +
    -% if 'nex' in recent_weapons or 'rifle' in recent_weapons or 'minstanex' in recent_weapons or 'uzi' in recent_weapons or 'shotgun' in recent_weapons: -
    -
    -

    Accuracy

    -
    -
    - -
    -
      - % if 'nex' in recent_weapons: -
    • -
      - -

      Nex

      - -
      -
    • - % endif - - % if 'rifle' in recent_weapons: -
    • -
      - -

      Rifle

      - -
      -
    • - % endif - - % if 'minstanex' in recent_weapons: -
    • -
      - -

      Minstanex

      - -
      -
    • - % endif - - % if 'uzi' in recent_weapons: -
    • -
      - -

      Uzi

      - -
      -
    • - % endif - - % if 'shotgun' in recent_weapons: -
    • -
      - -

      Shotgun

      - -
      -
    • - % endif -
    -
    - -
    -
    -% endif + ##### LEFT PANE ##### +
    +

    + % if g.game_type_cd in overall_stats: + Last Played: ${overall_stats[g.game_type_cd].last_played_fuzzy}
    + % else: +
    + % endif + Games Played: + % if g.game_type_cd == 'overall': + + % else: + + % endif + ${g.games}
    -% if 'rocketlauncher' in recent_weapons or 'grenadelauncher' in recent_weapons or 'electro' in recent_weapons or 'crylink' in recent_weapons or 'laser' in recent_weapons: -

    -
    -

    Damage Efficiency

    -
    -
    + Playing Time: ${overall_stats[g.game_type_cd].total_playing_time}
    -
    -
      - % if 'rocketlauncher' in recent_weapons: -
    • -
      - -

      Rocket

      - -
      -
    • - % endif + % if g.game_type_cd in fav_maps: + Favorite Map: ${fav_maps[g.game_type_cd].map_name}
      + % else: +
      + % endif - % if 'grenadelauncher' in recent_weapons: -
    • -
      - -

      Mortar

      - + % if g.game_type_cd == 'ctf': + % if overall_stats[g.game_type_cd].total_captures is not None: + Fastest flag captures...
      + % else: +
      + % endif + % else: +
      + % endif +

      -
    • - % endif - % if 'electro' in recent_weapons: -
    • -
      - -

      Electro

      - -
      -
    • - % endif + ##### RIGHT PANE ##### +
      +

      + % if g.win_pct is not None: + Win Percentage: ${round(g.win_pct,2)}% (${g.wins} wins, ${g.losses} losses)
      + % endif - % if 'crylink' in recent_weapons: -

    • -
      - -

      Crylink

      - -
      -
    • - % endif + % if g.game_type_cd in overall_stats: + % if overall_stats[g.game_type_cd].k_d_ratio is not None: + Kill Ratio: ${round(overall_stats[g.game_type_cd].k_d_ratio,2)} (${overall_stats[g.game_type_cd].total_kills} kills, ${overall_stats[g.game_type_cd].total_deaths} deaths)
      + % endif + % else: +
      + % endif - % if 'hagar' in recent_weapons: -
    • -
      - -

      Hagar

      - -
      -
    • - % endif + % if g.game_type_cd in elos: + % if g.game_type_cd == 'overall': + Best Elo: ${round(elos[g.game_type_cd].elo,2)} (${elos[g.game_type_cd].game_type_cd}, ${elos[g.game_type_cd].games} games)
      + % else: + Elo: ${round(elos[g.game_type_cd].elo,2)} (${elos[g.game_type_cd].games} games)
      + % endif + % else: +
      + % endif - % if 'laser' in recent_weapons: -
    • -
      - -

      Laser

      - + % if g.game_type_cd == 'ctf': + % if overall_stats[g.game_type_cd].cap_ratio is not None: + Cap Ratio: ${round(overall_stats[g.game_type_cd].cap_ratio,2)} (${overall_stats[g.game_type_cd].total_captures} captures, ${overall_stats[g.game_type_cd].total_pickups} pickups)
      + % else: +
      + % endif + % else: +
      + % endif +

      -
    • - % endif - -
    + % endfor +
    +##### ACCURACY CHART #### +
    +
    +
    Weapon Accuracy
    + +
    + +
    -% endif +##### DAMAGE CHART #### +
    +
    +
    Weapon Damage
    + +
    + +
    +
    +
    ##### RECENT GAMES (v2) #### % if recent_games: -
    -
    -

    Recent Games

    - - - - - - - - - - - - - - % for rg in recent_games: - - - - - - - - - - % endfor - -
    TypeServerMapResultPlayedElo
    view${rg.server_name}${rg.map_name} - % if rg.team != None: - % if rg.team == rg.winner: - Win - % else: - Loss - % endif - % else: - % if rg.rank == 1: - Win - % else: - Loss (#${rg.rank}) - % endif - % endif - ${rg.fuzzy_date} - - % if rg.elo_delta is not None: - % if round(rg.elo_delta,2) > 0: - - % elif round(rg.elo_delta,2) < 0: - - % else: - - % endif - % else: - - % endif - -
    - % if total_games > 10: -

    More...

    - % endif +
    +
    +
    Recent Games
    + + + + + + + + + + + + + + % for rg in recent_games: + + + + + + + + + + % endfor + +
    TypeServerMapResultPlayedElo
    view${rg.server_name}${rg.map_name} + % if rg.team != None: + % if rg.team == rg.winner: + Win + % else: + Loss + % endif + % else: + % if rg.rank == 1: + Win + % else: + Loss (#${rg.rank}) + % endif + % endif + ${rg.fuzzy_date} + + % if rg.elo_delta is not None: + % if round(rg.elo_delta,2) > 0: + +${round(rg.elo_delta,2)} + % elif round(rg.elo_delta,2) < 0: + ${round(rg.elo_delta,2)} + % else: + + % endif + % else: + + % endif + +
    +
    -
    -% endif % endif