]> de.git.xonotic.org Git - xonotic/xonstat.git/blobdiff - xonstat/templates/player_info.mako
Merge branch 'badges' into approved
[xonotic/xonstat.git] / xonstat / templates / player_info.mako
old mode 100755 (executable)
new mode 100644 (file)
index b2e9fa6..c88c96c
 <%inherit file="base.mako"/>
+<%namespace name="nav" file="nav.mako" />
 <%namespace file="accuracy.mako" import="accuracy" />
 
-<%block name="css">
-${parent.css()}
-<link rel="stylesheet" href="/static/css/colorbox.css" type="text/css" media="screen" />
+<%block name="navigation">
+${nav.nav('players')}
 </%block>
 
 <%block name="js">
-${parent.js()}
-<script src="/static/js/jquery.colorbox-min.js"></script>
+    % if player is not None:
+      <script src="/static/js/jquery.flot.min.js"></script>
+      <script src="/static/js/bootstrap-tabs.js"></script>
+      <script type="text/javascript">
+      jQuery(document).ready(function ($) {
+          $(".tabs").tabs();
+      });      
+
+      $(function () {
+          // plot the accuracy graph
+          function plot_acc_graph(data) {
+              var games = new Array();
+              var avgs = new Array();
+              var accs = new Array();
+
+              var i=0;
+              for(i=0; i < data.games; i++) {
+                  avgs[i] = [i, data.avg];
+                  accs[i] = [i, data.accs[i][1]];
+                  game_link = '/game/' + data.accs[i][0];
+                  j = data.games - i;
+                  games[i] = [i, '<a href="' + game_link + '">' + j + '</a>'];
+              }
+
+              $.plot(
+                  $("#acc-graph"), 
+                  [ { label: 'average', data: avgs, hoverable: true, clickable: false }, 
+                    { label: 'accuracy', data: accs, lines: {show:true}, points: {show:false}, hoverable: true, clickable: true }, ],
+                  { yaxis: {ticks: 10, min: 0, max: 100 },
+                    xaxis: {ticks: games},
+                    grid: { hoverable: true, clickable: true },
+              });
+          }
+
+          // plot the damage graph
+          function plot_dmg_graph(data) {
+              var games = new Array();
+              var avgs = new Array();
+              var dmgs = new Array();
+
+              var i=0;
+              for(i=0; i < data.games; i++) {
+                  avgs[i] = [i, data.avg];
+                  dmgs[i] = [i, data.dmgs[i][1]];
+                  game_link = '/game/' + data.dmgs[i][0];
+                  j = data.games - i;
+                  games[i] = [i, '<a href="' + game_link + '">' + j + '</a>'];
+              }
+
+              $.plot(
+                  $("#dmg-graph"), 
+                  [ { label: 'average', data: avgs, hoverable: true, clickable: false }, 
+                    { label: 'efficiency', data: dmgs, lines: {show:true}, points: {show:false}, hoverable: true, clickable: true }, ],
+                  { yaxis: {ticks: 10, min: 0 },
+                    xaxis: {ticks: games},
+                    grid: { hoverable: true, clickable: true },
+              });
+          }
+
+          function showTooltip(x, y, contents) {
+            $('<div id="tooltip">' + contents + '</div>').css( {
+                position: 'absolute',
+                display: 'none',
+                top: y - 35,
+                left: x + 10,
+                border: '1px solid #fdd',
+                padding: '2px',
+                'background-color': '#333333',
+                opacity: 0.80
+            }).appendTo("body").fadeIn(200);
+          }
+
+          var previousPoint = null;
+          var previousLabel = null;
+          $('#acc-graph').bind("plothover", function (event, pos, item) {
+              if (item) {
+                  if ((previousLabel != item.series.label) || (previousPoint != item.dataIndex)) {
+                    previousPoint = item.dataIndex;
+                    previousLabel = item.series.label;
+
+                    $("#tooltip").remove();
+                    var x = item.datapoint[0].toFixed(2),
+                        y = item.datapoint[1].toFixed(2);
+
+                    showTooltip(item.pageX, item.pageY, y + "%");
+                  }
+              }
+              else {
+                  $("#tooltip").remove();
+                  previousPoint = null;
+                  previousLabel = null;
+              }
+          });
+
+          $('#dmg-graph').bind("plothover", function (event, pos, item) {
+              if (item) {
+                  if ((previousLabel != item.series.label) || (previousPoint != item.dataIndex)) {
+                    previousPoint = item.dataIndex;
+                    previousLabel = item.series.label;
+
+                    $("#tooltip").remove();
+                    var x = item.datapoint[0].toFixed(2),
+                        y = item.datapoint[1].toFixed(2);
+
+                    showTooltip(item.pageX, item.pageY, y);
+                  }
+              }
+              else {
+                  $("#tooltip").remove();
+                  previousPoint = null;
+                  previousLabel = null;
+              }
+          });
+
+          // bind click events to the weapon images
+          $(".acc-weap").click(function () {
+              var dataurl = $(this).find('a').attr('href');
+
+              $('.accuracy-nav').find('.weapon-active').removeClass('weapon-active');
+              $(this).addClass('weapon-active');
+
+              $.ajax({
+                  url: dataurl,
+                  method: 'GET',
+                  dataType: 'json',
+                  success: plot_acc_graph
+              });
+          });
+
+          $(".dmg-weap").click(function () {
+              var dataurl = $(this).find('a').attr('href');
+
+              $('.damage-nav').find('.weapon-active').removeClass('weapon-active');
+              $(this).addClass('weapon-active');
+
+              $.ajax({
+                  url: dataurl,
+                  method: 'GET',
+                  dataType: 'json',
+                  success: plot_dmg_graph
+              });
+          });
+
+          // populate the graphs with the default weapons
+          $.ajax({
+              url: '${request.route_url("player_accuracy", id=player.player_id)}',
+              method: 'GET',
+              dataType: 'json',
+              success: plot_acc_graph
+          });
+
+          $.ajax({
+              url: '${request.route_url("player_damage", id=player.player_id)}',
+              method: 'GET',
+              dataType: 'json',
+              success: plot_dmg_graph
+          });
+      })
+      </script>
+      <script src="/static/js/bootstrap-tabs.min.js"></script>
+    % endif
 </%block>
 
 <%block name="title">
-% if player:
-Player Information for ${player.nick_strip_colors()} - 
-% endif
-
-${parent.title()}
+Player Information
 </%block>
 
 
@@ -25,97 +180,424 @@ ${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()|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>
-% endif
+<div class="row">
+  <div class="span12">
+    <h2>${player.nick_html_colors()|n}</h2>
+  </div>
+</div>
+
+<div class="row">
+  <div class="span6">
+    <p>
+      Member Since: <small>${player.create_dt.strftime('%m/%d/%Y at %I:%M %p')} </small><br />
 
+      Last Seen: <small><span class="abstime" data-epoch="${recent_games[0][1].epoch()}" title="${recent_games[0][1].create_dt.strftime('%a, %d %b %Y %H:%M:%S UTC')}">${recent_games[0][1].fuzzy_date()}</span> </small><br />
 
-##### STATS #####
-% if game_stats:
-<h2>Overall Game Stats</h2>
-<table id="player-game-stats">
-       <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>
+      Playing Time: <small>${total_stats['alivetime']}
+      % if total_stats['alivetime_month'] and total_stats['alivetime'] > total_stats['alivetime_month']:
+          % if total_stats['alivetime_week'] and total_stats['alivetime_month'] > total_stats['alivetime_week']:
+              <br />(${total_stats['alivetime_month']} this month; ${total_stats['alivetime_week']} this week)
+          % else:
+              <br />(${total_stats['alivetime_month']} this month)
+          % endif
+      % endif
+      </small><br />
+
+      <% games_breakdown_str = ', '.join(["{0} {1}".format(ng, gt) for (gt, ng) in total_stats['games_breakdown'].items()]) %>
+      Games Played: <small>${total_stats['games']}<br />(${games_breakdown_str})</small><br />
+    </p>
+  </div>
+  <div class="span6">
+    <p>
+      % if fav_server is not None:
+      Favorite Server: <small><a href="${request.route_url('server_info', id=fav_server[0]['id'])}" title="view server info">${fav_server[0]['name']}</a></small><br />
+      % endif
+
+      % if fav_map is not None:
+      Favorite Map: <small><a href="${request.route_url('map_info', id=fav_map[0]['id'])}" title="view map info">${fav_map[0]['name']}</a></small><br />
+      % endif
+
+      % if fav_weapon is not None:
+      Favorite Weapon: <small>${fav_weapon[0]['name']}</small><br />
+      % endif
+
+      % if total_stats['games'] > 0 and total_stats['wins'] is not None:
+      Win Percentage: <small>${round(float(total_stats['wins'])/total_stats['games'] * 100, 2)}% (${total_stats['wins']} wins, ${total_stats['games'] - total_stats['wins']} losses) </small><br />
+      % endif
+
+      % if total_stats['kills'] > 0 and total_stats['deaths'] > 0:
+      Kill Ratio: <small>${round(float(total_stats['kills'])/total_stats['deaths'], 3)} (${total_stats['kills']} kills, ${total_stats['deaths']} deaths, ${total_stats['suicides']} suicides) </small><br />
+      % endif
+    </p>
+  </div>
+</div>
+
+<div class="row">
+  <div class="span12">
+    <p>
+       % if elos_display is not None and len(elos_display) > 0:
+       Elo:
+          <small>${elos_display} </small>
+          %if '*' in elos_display:
+              <small><i>*preliminary Elo</i></small>
+          %endif
+          <br />
+      % endif
+
+      % if ranks_display != '':
+      Ranks: <small>${ranks_display}</small><br />
+      % endif
+    </p>
+  </div>
+</div>
+
+% 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:
+<div class="row">
+  <div class="span10">
+    <h3>Accuracy</h3>
+    <div id="acc-graph" class="flot" style="width:900px; height:200px;">
+    </div>
+
+    <div class="weapon-nav accuracy-nav">
+      <ul>
+        % if 'nex' in recent_weapons:
+        <li>
+          <div class="acc-weap weapon-active">
+            <img src="${request.static_url("xonstat:static/images/nex.png")}" />
+            <p><small>Nex</small></p>
+            <a href="${request.route_url('player_accuracy', id=player.player_id, _query=[('weapon','nex')])}" title="Show nex accuracy"></a>
+          </div>
+        </li>
+        % endif
+
+        % if 'rifle' in recent_weapons:
+        <li>
+          <div class="acc-weap">
+            <img src="${request.static_url("xonstat:static/images/rifle.png")}" />
+            <p><small>Rifle</small></p>
+            <a href="${request.route_url('player_accuracy', id=player.player_id, _query=[('weapon','rifle')])}" title="Show rifle accuracy"></a>
+          </div>
+        </li>
+        % endif
+
+        % if 'minstanex' in recent_weapons:
+        <li>
+          <div class="acc-weap">
+            <img src="${request.static_url("xonstat:static/images/minstanex.png")}" />
+            <p><small>Minstanex</small></p>
+            <a href="${request.route_url('player_accuracy', id=player.player_id, _query=[('weapon','minstanex')])}" title="Show minstanex accuracy"></a>
+          </div>
+        </li>
+        % endif
+
+        % if 'uzi' in recent_weapons:
+        <li>
+          <div class="acc-weap">
+            <img src="${request.static_url("xonstat:static/images/uzi.png")}" />
+            <p><small>Uzi</small></p>
+            <a href="${request.route_url('player_accuracy', id=player.player_id, _query=[('weapon','uzi')])}" title="Show uzi accuracy"></a>
+          </div>
+        </li>
+        % endif
+
+        % if 'shotgun' in recent_weapons:
+        <li>
+          <div class="acc-weap">
+            <img src="${request.static_url("xonstat:static/images/shotgun.png")}" />
+            <p><small>Shotgun</small></p>
+            <a href="${request.route_url('player_accuracy', id=player.player_id, _query=[('weapon','shotgun')])}" title="Show shotgun accuracy"></a>
+          </div>
+        </li>
+        % endif
+      </ul>
+    </div>
+
+  </div>
+</div>
 % endif
 
-##### ACCURACY #####
-% if weapon_stats:
-<h2>Overall Accuracy</h2>
-${accuracy(weapon_stats)}
+
+% 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:
+<div class="row">
+  <div class="span10">
+    <h3>Damage Efficiency</h3>
+    <div id="dmg-graph" class="flot" style="width:900px; height:200px;">
+    </div>
+
+    <div class="weapon-nav damage-nav">
+      <ul>
+        % if 'rocketlauncher' in recent_weapons:
+        <li>
+          <div class="dmg-weap weapon-active">
+            <img src="${request.static_url("xonstat:static/images/rocketlauncher.png")}" />
+            <p><small>Rocket</small></p>
+            <a href="${request.route_url('player_damage', id=player.player_id, _query=[('weapon','rocketlauncher')])}" title="Show rocket launcher efficiency"></a>
+          </div>
+        </li>
+        % endif
+
+        % if 'grenadelauncher' in recent_weapons:
+        <li>
+          <div class="dmg-weap">
+            <img src="${request.static_url("xonstat:static/images/grenadelauncher.png")}" />
+            <p><small>Mortar</small></p>
+            <a href="${request.route_url('player_damage', id=player.player_id, _query=[('weapon','grenadelauncher')])}" title="Show mortar damage efficiency"></a>
+          </div>
+        </li>
+        % endif
+
+        % if 'electro' in recent_weapons:
+        <li>
+          <div class="dmg-weap">
+            <img src="${request.static_url("xonstat:static/images/electro.png")}" />
+            <p><small>Electro</small></p>
+            <a href="${request.route_url('player_damage', id=player.player_id, _query=[('weapon','electro')])}" title="Show electro damage efficiency"></a>
+          </div>
+        </li>
+        % endif
+
+        % if 'crylink' in recent_weapons:
+        <li>
+          <div class="dmg-weap">
+            <img src="${request.static_url("xonstat:static/images/crylink.png")}" />
+            <p><small>Crylink</small></p>
+            <a href="${request.route_url('player_damage', id=player.player_id, _query=[('weapon','crylink')])}" title="Show crylink damage efficiency"></a>
+          </div>
+        </li>
+        % endif
+
+        % if 'hagar' in recent_weapons:
+        <li>
+          <div class="dmg-weap">
+            <img src="${request.static_url("xonstat:static/images/hagar.png")}" />
+            <p><small>Hagar</small></p>
+            <a href="${request.route_url('player_damage', id=player.player_id, _query=[('weapon','hagar')])}" title="Show hagar damage efficiency"></a>
+          </div>
+        </li>
+        % endif
+
+        % if 'laser' in recent_weapons:
+        <li>
+          <div class="dmg-weap">
+            <img src="${request.static_url("xonstat:static/images/laser.png")}" />
+            <p><small>Laser</small></p>
+            <a href="${request.route_url('player_damage', id=player.player_id, _query=[('weapon','laser')])}" title="Show laser damage efficiency"></a>
+          </div>
+        </li>
+        % endif
+
+      </ul>
+    </div>
+
+  </div>
+</div>
 % endif
 
+<div class="row">
+  <div class="span8 tabbable">
+    <h3>Game Breakdown</h3>
+    <ul class="tabs nav nav-pills" data-tabs="tabs">
+    <% gametypes = ['Overall', 'Duel', 'DM', 'TDM', 'CTF'] %>
+    % for gtc in gametypes:
+      % if gtc.lower() == 'overall' or total_stats['games_breakdown'].has_key(gtc.lower()):
+        % if gtc.lower() == 'overall':
+      <li class="active">
+        % else:
+      <li>
+        % endif
+        <a href="#breakdown-${gtc.lower()}" data-toggle="tabs">${gtc}</a>
+      </li>
+      % endif
+    % endfor
+    </ul>
+    <div class="tab-content">
+    % for gtc in gametypes:
+      <% gtc_key = gtc.lower() %>
+      % if gtc_key == "overall":
+        <% total     = total_stats['games'] %>
+        <% alivetime = total_stats['alivetime'] %>
+        <% wins      = total_stats['wins'] %>
+        <% losses    = total - wins %>
+        <% kills     = total_stats['kills'] %>
+        <% deaths    = total_stats['deaths'] %>
+        <% suicides  = total_stats['suicides'] %>
+      % elif total_stats['games_breakdown'].has_key(gtc_key):
+        <% total     = total_stats['games_breakdown'][gtc_key] %>
+        <% alivetime = total_stats['games_alivetime'][gtc_key] %>
+        <% wins      = total_stats[gtc_key+'_wins'] %>
+        <% losses    = total - wins %>
+        % if gtc_key == "ctf":
+          <% caps      = total_stats[gtc_key+'_caps'] %>
+          <% pickups   = total_stats[gtc_key+'_pickups'] %>
+          <% returns   = total_stats[gtc_key+'_returns'] %>
+          <% drops     = total_stats[gtc_key+'_drops'] %>
+          <% fckills   = total_stats[gtc_key+'_fckills'] %>
+        % else:
+          <% kills     = total_stats[gtc_key+'_kills'] %>
+          <% deaths    = total_stats[gtc_key+'_deaths'] %>
+          <% suicides  = total_stats[gtc_key+'_suicides'] %>
+        % endif
+      % endif
+      % if gtc_key == 'overall' or total_stats['games_breakdown'].has_key(gtc_key):
+        % if gtc_key == 'overall':
+      <div class="tab-pane active" id="breakdown-${gtc_key}">
+        % else:
+      <div class="tab-pane" id="breakdown-${gtc_key}">
+        % endif
+        <div style="margin:15px;float:left;"><img title="${gtc}" src="/static/images/icons/48x48/${gtc_key}.png" alt="${gtc}" /></div>
+        <table class="table table-bordered table-condensed">
+          <thead>
+          </thead>
+          <tbody>
+            <tr>
+              <td><b>Games Played:</b></td>
+              <td>${total}</td>
+              % if gtc_key == 'overall':
+              <td></td>
+              % else:
+              <td>${round(float(total)/total_stats['games'] * 100, 2)}% of all games</td>
+              % endif
+            </tr>
+            <tr>
+              <td><b>Playing Time:</b></td>
+              <td>${alivetime} hours</td>
+              % if gtc_key == 'overall':
+              <td></td>
+              % else:
+              <td>${round(float(alivetime.total_seconds())/total_stats['alivetime'].total_seconds() * 100, 2)}% of total playing time</td>
+              % endif
+            </tr>
+            <tr>
+              <td width="30%"><b>Win Percentage:</b></td>
+              <td width="30%">${round(float(wins)/total * 100, 2)}%</td>
+              <td width="40%">${wins} wins, ${losses} losses</td>
+            </tr>
+            % if gtc_key == 'ctf':
+            <tr>
+              <td><b>Caps:</b></td>
+              <td>${round(float(caps)/total, 2)} per game</td>
+              <td>${caps} total</td>
+            </tr>
+            <tr>
+              <td><b>Pickups:</b></td>
+              <td>${round(float(pickups)/total, 2)} per game</td>
+              <td>${pickups} total</td>
+            </tr>
+            <tr>
+              <td><b>Drops:</b></td>
+              <td>${round(float(drops)/total, 2)} per game</td>
+              <td>${drops} total</td>
+            </tr>
+            <tr>
+              <td><b>Returns:</b></td>
+              <td>${round(float(returns)/total, 2)} per game</td>
+              <td>${returns} total</td>
+            </tr>
+            <tr>
+              <td><b>FC Kills:</b></td>
+              <td>${round(float(fckills)/total, 2)} per game</td>
+              <td>${fckills} total</td>
+            </tr>
+            <tr>
+              <td><b>Cap Ratio:</b></td>
+              <td>${round(float(caps)/pickups, 3)}</td>
+              <td></td>
+            </tr>
+            <tr>
+              <td><b>Drop Ratio:</b></td>
+              <td>${round(float(drops)/pickups, 3)}</td>
+              <td></td>
+            </tr>
+            <tr>
+              <td><b>Return Ratio:</b></td>
+              <td>${round(float(returns)/fckills, 3)}</td>
+              <td></td>
+            </tr>
+            % else:
+            <tr>
+              <td><b>Kills:</b></td>
+              <td>${round(float(kills)/total, 2)} per game</td>
+              <td>${kills} total</td>
+            </tr>
+            <tr>
+              <td><b>Deaths:</b></td>
+              <td>${round(float(deaths)/total, 2)} per game</td>
+              <td>${deaths} total</td>
+            </tr>
+            <tr>
+              <td><b>Suicides:</b></td>
+              <td>${round(float(suicides)/total, 2)} per game</td>
+              <td>${suicides} total</td>
+            </tr>
+            <tr>
+              <td><b>Kill Ratio:</b></td>
+              <td>${round(float(kills)/deaths, 3)}</td>
+              <td></td>
+            </tr>
+            <tr>
+              <td><b>Suicide Ratio:</b></td>
+              <td>${round(float(suicides)/deaths, 3)}</td>
+              <td></td>
+            </tr>
+            % endif
+          </tbody>
+        </table>
+      </div>
+      % endif
+    % endfor
+    </div>
+  </div>
+</div>
+
 
 ##### RECENT GAMES (v2) ####
 % if recent_games:
-<h2>Recent Games</h2>
-<table>
-       <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>${game.game_type_cd}</td>
-                  <td>${map.name}</td>
-                  <td>
-                  % if gamestat.team != None and gamestat.team == game.winner:
-                  Win
-                  % else:
-                  Loss
-                  % 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>
-<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}...
+<br />
+<div class="row">
+  <div class="span12">
+    <h3>Recent Games</h3>
+    <table class="table table-bordered table-condensed">
+      <thead>
+        <tr>
+           <th></th>
+           <th>Type</th>
+           <th>Server</th>
+           <th>Map</th>
+           <th>Result</th>
+           <th>Played</th>
+        </tr>
+      </thead>
+      <tbody>
+      % for (gamestat, game, server, map) in recent_games:
+        <tr>
+           <td><a class="btn btn-primary btn-small" href="${request.route_url('game_info', id=game.game_id)}" title="View detailed information about this game">view</a></td>
+           <td style="width:20px;"><img title="${game.game_type_cd}" src="/static/images/icons/24x24/${game.game_type_cd}.png" alt="${game.game_type_cd}" /></td>
+           <td>${server.name}</td>
+           <td>${map.name}</td>
+           <td>
+           % if gamestat.team != None:
+             % if gamestat.team == game.winner:
+             Win
+             % else:
+             Loss
+             % endif
+          % else:
+            % if gamestat.rank == 1:
+            Win
+            % else:
+            Loss (#${gamestat.rank})
+            % endif
+          % endif
+           </td>
+           <td><span class="abstime" data-epoch="${game.epoch()}" title="${game.create_dt.strftime('%a, %d %b %Y %H:%M:%S UTC')}">${game.fuzzy_date()}</span></td>
+        </tr>
+      % endfor
+      </tbody>
+    </table>
+    % if total_games > 10:
+    <a href="${request.route_url("player_game_index", player_id=player.player_id, page=1)}" title="Game index for ${player.nick}">More games played by ${player.nick_html_colors()|n}...</a>
+    % endif
+  </div>
+</div>
+% endif
 % endif