]> de.git.xonotic.org Git - xonotic/xonstat.git/blobdiff - xonstat/templates/player_info.mako
Gridify the player and server info pages.
[xonotic/xonstat.git] / xonstat / templates / player_info.mako
index 561da175b40ab27a36b437fd46f513984b253937..ba4a84b846d6eb1372826dd437b60c84121825d2 100755 (executable)
@@ -1,11 +1,13 @@
 <%inherit file="base.mako"/>
+<%namespace name="nav" file="nav.mako" />
+<%namespace file="accuracy.mako" import="accuracy" />
 
-<%block name="title">
-% if player:
-Player Information for ${player.nick_html_colors()} - 
-% endif
+<%block name="navigation">
+${nav.nav('players')}
+</%block>
 
-${parent.title()}
+<%block name="title">
+Player Information
 </%block>
 
 
@@ -14,18 +16,116 @@ ${parent.title()}
 <p>Seriously though, he probably doesn't exist...just a figment of your imagination. Carry on then!</p>
 
 % else:
-<h2>${player.nick_html_colors()}</h2>
-<p>
-   Joined: ${player.create_dt.strftime('%m/%d/%Y at %I:%M %p')} <br />
-</p>
+<div class="row">
+  <div class="span5">
+    <h2>${player.nick_html_colors()|n}</h2>
+    <p>
+       Member Since: ${player.create_dt.strftime('%m/%d/%Y at %I:%M %p')} <br />
+       Last Seen: ${recent_games[0][1].fuzzy_date()} <br />
+       Playing Time: ${game_stats['total_alivetime']} <br />
+       Games Played: ${game_stats['total_games_played']} <br />
+       Average Rank: ${game_stats['avg_rank']} <br />
+    </p>
+  </div>
+</div>
+% endif
+
+
+% if game_stats:
+<div class="row">
+  <div class="span12">
+    <h3>Overall Game Stats</h2>
+    <table class="table table-bordered table-condensed">
+      <thead>
+        <tr>
+          <th>Score</th>
+          <th>Carrier Kills</th>
+          <th>Kills</th>
+          <th>Collects</th>
+          <th>Deaths</th>
+          <th>Destroys</th>
+          <th>Suicides</th>
+          <th>Destroys (with key)</th>
+          <th>Captures</th>
+          <th>Pushes</th>
+          <th>Pickups</th>
+          <th>Pushed</th>
+          <th>Drops</th>
+          <th>Returns</th>
+        </tr>
+      </thead>
+      <tbody>
+        <tr>
+          <td>${game_stats['total_score']}</td>
+          <td>${game_stats['total_carrier_frags']}</td>
+          <td>${game_stats['total_kills']}</td>
+          <td>${game_stats['total_collects']}</td>
+          <td>${game_stats['total_deaths']}</td>
+          <td>${game_stats['total_destroys']}</td>
+          <td>${game_stats['total_suicides']}</td>
+          <td>${game_stats['total_destroys']}</td>
+          <td>${game_stats['total_captures']}</td>
+          <td>${game_stats['total_pushes']}</td>
+          <td>${game_stats['total_pickups']}</td>
+          <td>${game_stats['total_pushed']}</td>
+          <td>${game_stats['total_drops']}</td>
+          <td>${game_stats['total_returns']}</td>
+        </tr>
+      </tbody>
+    </table>
+    % endif
+  </div>
+</div>
+
+
+% if weapon_stats:
+<div class="row">
+  <div class="span12">
+    <h3>Overall Accuracy</h3>
+    ${accuracy(weapon_stats)}
+  </div>
+</div>
 % endif
 
+
+##### RECENT GAMES (v2) ####
 % if recent_games:
-<h2>Recent Games</h2>
-<ul>
-% for (gamestat, game, server, map) in recent_games:
-   <li><a href="${request.route_url("game_info", id=game.game_id)}" name="Game info page for game #${game.game_id}">#${game.game_id}:</a> <a href="${request.route_url("map_info", id=map.map_id)}" name="Map info page for ${map.name}">${map.name}</a> on <a href="${request.route_url("server_info", id=server.server_id)}" name="Server info page for ${server.name}">${server.name}</a></li>
-% endfor
-</ul>
-<a href="${request.route_url("player_game_index", player_id=player.player_id, page=1)}" title="Game index for ${player.nick}">More games</a> played by ${player.nick_html_colors()}...
+<div class="row">
+  <div class="span6">
+    <h3>Recent Games</h3>
+    <table class="table table-bordered table-condensed">
+      <thead>
+        <tr>
+           <th>Game Type</th>
+           <th>Map</th>
+           <th>Result</th>
+           <th>Played</th>
+           <th>Permalink</th>
+        </tr>
+      </thead>
+      <tbody>
+      % for (gamestat, game, server, map) in recent_games:
+        <tr>
+           <td><img title="${game.game_type_cd}" src="/static/images/icons/24x24/${game.game_type_cd}.png" alt="${game.game_type_cd}" /></td>
+           <td>${map.name}</td>
+           <td>
+           % if gamestat.team != None and gamestat.team == game.winner:
+           Won (#${gamestat.rank})
+           % elif gamestat.team != None and gamestat.team != game.winner:
+           Lost (#${gamestat.rank})
+               % else:
+               #${gamestat.rank}
+           % endif
+           </td>
+           <td>${game.fuzzy_date()}</td>
+           <td><a class="recent_game_box" href="${request.route_url("game_info", id=game.game_id)}" name="Game info page for game #${game.game_id}">View</a></td>
+        </tr>
+      % endfor
+      </tbody>
+    </table>
+    % if game_stats['total_games_played'] > 10:
+    <a href="${request.route_url("player_game_index", player_id=player.player_id, page=1)}" title="Game index for ${player.nick}">More games</a> played by ${player.nick_html_colors()|n}...
+    % endif
+  </div>
+</div>
 % endif