]> de.git.xonotic.org Git - xonotic/xonstat.git/blobdiff - xonstat/templates/player_info.mako
Use the gametype icons in the tabs!
[xonotic/xonstat.git] / xonstat / templates / player_info.mako
index bdea7a541b90c3a42a1ff1f663427aaae97b9271..6ec476e68da170501f0277cb88a535b562e57787 100644 (file)
@@ -13,12 +13,12 @@ ${nav.nav('players')}
       <script src="/static/js/bootstrap-tab.js"></script>
       <script type="text/javascript">
       $(function () {
-        $('#gbtab').click(function(e) {
+        $('#gbtab li').click(function(e) {
             e.preventDefault();
             $(this).tab('show');
         })
 
-      $('#gbtab a:first').tab('show');
+        $('#gbtab a:first').tab('show');
       })
       </script>
 
@@ -194,13 +194,7 @@ Player Information
 </div>
 
 <div class="row">
-  <div id="gbtabcontainer" class="tabbable tabs-right">
-      <ul id="gbtab" class="nav nav-tabs">
-      % for g in games_played:
-        <li><a href="#tab-${g.game_type_cd}" data-toggle="tab">${g.game_type_cd} (${g.games})</a></li>
-      % endfor
-      </ul>
-
+  <div id="gbtabcontainer" class="tabbable tabs-below">
       <div class="tab-content">
       % for g in games_played:
         <div class="tab-pane fade in 
@@ -211,22 +205,26 @@ Player Information
           <div class="span5">
             <p>
             % if g.game_type_cd in overall_stats:
-            Last Played: <small>${overall_stats[g.game_type_cd].last_played.strftime('%a, %d %b %Y %H:%M UTC')} <br /></small>
+            Last Played: <small><span class="abstime" data-epoch="${overall_stats[g.game_type_cd].last_played_epoch}" title="${overall_stats[g.game_type_cd].last_played.strftime('%a, %d %b %Y %H:%M:%S UTC')}"> ${overall_stats[g.game_type_cd].last_played_fuzzy} </span> <br /></small>
             % endif
 
             Games Played: <small>${g.games} <br /></small>
 
+            Playing Time: <small>${overall_stats[g.game_type_cd].total_playing_time} <br /></small>
+
             % if g.game_type_cd in fav_maps:
             Favorite Map: <small>${fav_maps[g.game_type_cd].map_name} <br /></small>
             % endif
-
-            Win Percentage: <small>${round(g.win_pct,2)}% (${g.wins} wins, ${g.losses} losses) <br /></small>
             </p>
           </div>
           <div class="span5">
             <p>
+            Win Percentage: <small>${round(g.win_pct,2)}% (${g.wins} wins, ${g.losses} losses) <br /></small>
+
             % if g.game_type_cd in overall_stats:
-            Kill Ratio: <small>${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) <br /></small>
+              % if overall_stats[g.game_type_cd].k_d_ratio is not None:
+              Kill Ratio: <small>${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) <br /></small>
+              % endif
             % endif
 
             % if g.game_type_cd in elos:
@@ -239,15 +237,17 @@ Player Information
 
             % if g.game_type_cd in ranks:
               % if g.game_type_cd == 'overall':
-              Best Rank: <small>${ranks[g.game_type_cd].rank} of ${ranks[g.game_type_cd].max_rank} (${ranks[g.game_type_cd].game_type_cd})<br /></small>
+              Best Rank: <small>${ranks[g.game_type_cd].rank} of ${ranks[g.game_type_cd].max_rank} (${ranks[g.game_type_cd].game_type_cd}, percentile: ${round(ranks[g.game_type_cd].percentile,2)})<br /></small>
 
               % else:
-              Rank: <small>${ranks[g.game_type_cd].rank} of ${ranks[g.game_type_cd].max_rank} <br /></small>
+              Rank: <small>${ranks[g.game_type_cd].rank} of ${ranks[g.game_type_cd].max_rank} (percentile: ${round(ranks[g.game_type_cd].percentile,2)})<br /></small>
               % endif
             % endif
 
             % if g.game_type_cd == 'ctf':
-            Cap Ratio: <small>${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) <br /></small>
+              % if  overall_stats[g.game_type_cd].cap_ratio is not None:
+                Cap Ratio: <small>${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) <br /></small>
+              % endif
             % endif
             </p>
           </div>
@@ -256,6 +256,21 @@ Player Information
       </div>
   </div>
 </div>
+<div class="row">
+  <div class="span12">
+      <ul id="gbtab" class="nav nav-tabs">
+      % for g in games_played:
+        <li>
+          <a href="#tab-${g.game_type_cd}" data-toggle="tab">
+            <img src="/static/images/icons/24x24/${g.game_type_cd}.png"> <br />
+            ${g.game_type_cd} <br />
+            <small>(${g.games})</small>
+          </a>
+        </li>
+      % endfor
+      </ul>
+  </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: