From 362272e122519f112d72b72fd112df4342b43fdb Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Sun, 22 May 2011 10:20:04 -0400 Subject: [PATCH 1/1] Add html_colors support to player model. Use it in player templates! --- xonstat/models.py | 4 ++++ xonstat/templates/player_game_index.mako | 4 ++-- xonstat/templates/player_info.mako | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) 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 -- 2.39.2