From f86f4c291e5172289e20f914e19df4948c90a437 Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Mon, 23 May 2011 13:39:39 -0400 Subject: [PATCH] Add team color support --- xonstat/models.py | 10 ++++++++++ xonstat/templates/game_index.mako | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) mode change 100644 => 100755 xonstat/models.py diff --git a/xonstat/models.py b/xonstat/models.py old mode 100644 new mode 100755 index e75ccde..0e68b5c --- a/xonstat/models.py +++ b/xonstat/models.py @@ -87,6 +87,16 @@ class PlayerGameStat(object): def nick_html_colors(self): return html_colors(self.nick) + def team_html_color(self): + if self.team == 5: + return "#0000FF" + if self.team == 14: + return "#FF0000" + if self.team == 13: + return "#FFFF00" + if self.team == 10: + return "#FF00FF" + class GameMutator(object): def __repr__(self): diff --git a/xonstat/templates/game_index.mako b/xonstat/templates/game_index.mako index 8024184..883865e 100755 --- a/xonstat/templates/game_index.mako +++ b/xonstat/templates/game_index.mako @@ -13,7 +13,7 @@ Game Index - ${parent.title()}

${map.name} on ${server.name} (permalink for this game) - % if game.game_type_cd == 'ctf': +% if game.game_type_cd == 'ctf': @@ -38,7 +38,7 @@ Game Index - ${parent.title()} ${pgstat.nick_html_colors()} % endif - + -- 2.39.2
Nick Team${pgstat.team} ${pgstat.kills} ${pgstat.captures} ${pgstat.pickups}