From 491567c87a1f9ebd7308d64f0bbd34729f7bc817 Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Tue, 25 Sep 2012 22:47:18 -0400 Subject: [PATCH] Acceptable version of the games breakdown tab. This version does not have localized time. More code changes are needed to add it, and I just ran out of time. It is simple enough to add and will come soon. This commit basically styles the tabs and also adds a cap_ratio when you click on ctf. --- xonstat/static/css/style.css | 11 ++++++++- xonstat/templates/player_info.mako | 37 ++++++++++++++++++++++-------- xonstat/views/player.py | 2 +- 3 files changed, 39 insertions(+), 11 deletions(-) diff --git a/xonstat/static/css/style.css b/xonstat/static/css/style.css index dd29b0a..b47f14a 100755 --- a/xonstat/static/css/style.css +++ b/xonstat/static/css/style.css @@ -3503,4 +3503,13 @@ header h2 { display:none; } background-color: black; border: 0; } - +/* Player Info Tabs */ +#gbtabcontainer { margin-top: 10px; } +#gbtab { font-size: 12px; } +.tabs-right .nav-tabs { border: none; } +.nav-tabs > .active > a, .nav-tabs > .active > a:hover { background-color: #111; color: #aaa;} +.tabs-right .nav-tabs > li > a { border-radius: 4px 4px 4px 4px; } +.tabs-right .nav-tabs .active > a, .tabs-right .nav-tabs .active > a:hover { border-color: #222222 #222222 #222222 #222222; } +.tabs-right .nav-tabs > li > a:hover { border-color: #222222 #222222 #222222 #222222; } +.nav > li > a:hover { background-color: #333; color: #aaa; } +.tabbable p { font-size: 14px; } diff --git a/xonstat/templates/player_info.mako b/xonstat/templates/player_info.mako index 9787db8..bdea7a5 100644 --- a/xonstat/templates/player_info.mako +++ b/xonstat/templates/player_info.mako @@ -17,6 +17,8 @@ ${nav.nav('players')} e.preventDefault(); $(this).tab('show'); }) + + $('#gbtab a:first').tab('show'); }) @@ -192,7 +194,7 @@ Player Information
-
+
% endfor diff --git a/xonstat/views/player.py b/xonstat/views/player.py index 36ca55d..29ce3de 100644 --- a/xonstat/views/player.py +++ b/xonstat/views/player.py @@ -190,7 +190,7 @@ def get_overall_stats(player_id): k_d_ratio = None try: - cap_ratio = float(row.total_pickups)/row.total_captures + cap_ratio = float(row.total_captures)/row.total_pickups except: cap_ratio = None -- 2.39.2