From: Ant Zucaro Date: Mon, 23 May 2011 17:39:39 +0000 (-0400) Subject: Add team color support X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f86f4c291e5172289e20f914e19df4948c90a437;p=xonotic%2Fxonstat.git Add team color support --- 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 - +
Nick Team${pgstat.team} ${pgstat.kills} ${pgstat.captures} ${pgstat.pickups}