]> git.rm.cloudns.org Git - xonotic/xonstat.git/commitdiff
Show the active filter on the player_game_index.
authorAnt Zucaro <azucaro@gmail.com>
Fri, 19 Apr 2013 23:46:23 +0000 (19:46 -0400)
committerAnt Zucaro <azucaro@gmail.com>
Fri, 19 Apr 2013 23:46:23 +0000 (19:46 -0400)
xonstat/templates/player_game_index.mako
xonstat/views/player.py

index 5e26c588c82add6bcb0e7d00b78fd5cc5a517773..1a08bc159bb6c40e81937ba22a397551c34fbd72 100644 (file)
@@ -44,11 +44,15 @@ Recent Games
   <div class="span12 tabbable">
     <ul class="nav nav-tabs">
       % for game in games_played:
-      <li>
+      <li 
+      % if game.game_type_cd == game_type_cd or (game.game_type_cd == 'overall' and game_type_cd is None):
+      class="active"
+      % endif
+      >
       % if game.game_type_cd == 'overall':
       <a href="${request.route_url("player_game_index", player_id=player.player_id)}" alt="${game.game_type_cd}" title="" data-toggle="none">
       % else:
-      <a href="${request.route_url("player_game_index", player_id=player.player_id, _query={'game_type_cd':game.game_type_cd})}" alt="${game.game_type_cd}" title="" data-toggle="none">
+      <a href="${request.route_url("player_game_index", player_id=player.player_id, _query={'type':game.game_type_cd})}" alt="${game.game_type_cd}" title="" data-toggle="none">
       % endif
         <span class="sprite sprite-${game.game_type_cd}"> </span><br />
         ${game.game_type_cd} <br />
index 370bace94251cae19f8465041db3a436df61c02f..197a4d28b8301cd3e6a05fca75a02d01c2d74421 100644 (file)
@@ -600,8 +600,8 @@ def player_game_index_data(request):
     game_type_cd = None
     game_type_descr = None
 
-    if request.params.has_key('game_type_cd'):
-        game_type_cd = request.params['game_type_cd']
+    if request.params.has_key('type'):
+        game_type_cd = request.params['type']
         try:
             game_type_descr = DBSession.query(GameType.descr).\
                 filter(GameType.game_type_cd == game_type_cd).\