From: Ant Zucaro Date: Sun, 22 May 2011 14:20:04 +0000 (-0400) Subject: Add html_colors support to player model. Use it in player templates! X-Git-Url: https://git.xonotic.org/?a=commitdiff_plain;h=362272e122519f112d72b72fd112df4342b43fdb;hp=5a4036b9c323b9d2a0416dd2bda090cf77be7058;p=xonotic%2Fxonstat.git Add html_colors support to player model. Use it in player templates! --- diff --git a/xonstat/models.py b/xonstat/models.py index 317e004..e75ccde 100644 --- a/xonstat/models.py +++ b/xonstat/models.py @@ -10,6 +10,10 @@ Base = declarative_base() # define objects for all tables class Player(object): + + def nick_html_colors(self): + return html_colors(self.nick) + def __repr__(self): return "" % (self.player_id, self.nick, self.create_dt, self.location) diff --git a/xonstat/templates/player_game_index.mako b/xonstat/templates/player_game_index.mako index 7b23bf2..308fe43 100755 --- a/xonstat/templates/player_game_index.mako +++ b/xonstat/templates/player_game_index.mako @@ -1,14 +1,14 @@ <%inherit file="base.mako"/> <%block name="title"> -Player Game Index for ${player.nick} - ${parent.title()} +Player Game Index for ${player.nick_html_colors()} - ${parent.title()} % if not games:

Sorry, no games yet. Get playing, scrub!

% else: -

Recent Games by ${player.nick}

+

Recent Games by ${player.nick_html_colors()}

-More games played by ${player.nick}... +More games played by ${player.nick_html_colors()}... % endif