Added link to player captimes; fixed issue with ctf gametype on player_info page
authorJan Behrens <zykure@web.de>
Wed, 17 Apr 2013 19:04:23 +0000 (21:04 +0200)
committerJan Behrens <zykure@web.de>
Wed, 17 Apr 2013 19:04:23 +0000 (21:04 +0200)
xonstat/templates/player_captimes.mako
xonstat/templates/player_info.mako

index 7932e2b..fdb9462 100644 (file)
@@ -5,14 +5,15 @@
 Player captimes
 </%block>
 
+% if len(captimes) == 0:
+  <h2>Sorry, no caps yet. Get playing!</h2>
+% else:
+
 <div class="row">
   <div class="span12">
-
-    <h2><span class="nick">${player.nick_html_colors()|n}</span></h2>
+    <h3>Fastest Flag Captures by ${player.nick_html_colors()|n}</h3>
     <p><a href="${player_url}">Back to player info page</a></p>
-
-    <h3>Fastest flag capture times:</h3>
-
     <table class="table table-hover table-condensed">
       <thead>
         <tr>
@@ -37,3 +38,5 @@ Player captimes
 
   </div>
 </div>
+
+% endif
index 576c526..f51dac9 100644 (file)
@@ -220,6 +220,15 @@ Player Information
           % if g.game_type_cd in fav_maps:
           Favorite Map: <small>${fav_maps[g.game_type_cd].map_name} <br /></small>
           % endif
+          
+          % if g.game_type_cd == 'ctf':
+          % if overall_stats[g.game_type_cd].total_captures is not None:
+          <small><a href="${request.route_url("player_captimes", id=player.player_id)}">Fastest flag captures...</a></small>
+          % endif
+          % else:
+          <small><br /></small>
+          % endif
+          
           </p>
         </div>
         <div class="span5">
@@ -253,6 +262,8 @@ Player Information
           % 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
+          % else:
+          <small><br /></small>
           % endif
           </p>
         </div>