% else:
<div class="row">
- <div class="span5">
+ <div class="span8">
<h2>${player.nick_html_colors()|n}</h2>
<p>
- Member Since: ${player.create_dt.strftime('%m/%d/%Y at %I:%M %p')} <br />
- Last Seen: ${recent_games[0][1].fuzzy_date()} <br />
- Playing Time: ${game_stats['total_alivetime']} <br />
- Games Played: ${game_stats['total_games_played']} <br />
- Average Rank: ${game_stats['avg_rank']} <br />
+ Member Since: <small>${player.create_dt.strftime('%m/%d/%Y at %I:%M %p')} </small><br />
+ Last Seen: <small>${recent_games[0][1].fuzzy_date()} </small><br />
+ Playing Time: <small>${game_stats['total_alivetime']} </small><br />
+ Games Played: <small>${game_stats['total_games_played']} </small><br />
+ Average Rank: <small>${game_stats['avg_rank']} </small><br />
+ % if elos_display is not None and len(elos_display) > 0:
+ Elo:
+ <small>${', '.join(elos_display)} </small>
+ <br />
+ %if '*' in ', '.join(elos_display):
+ <small><i>*preliminary Elo</i></small>
+ %endif
+ % endif
</p>
</div>
</div>
player_id = int(request.matchdict['id'])\r
if player_id <= 2:\r
player_id = -1;\r
- \r
+\r
try:\r
player = DBSession.query(Player).filter_by(player_id=player_id).\\r
filter(Player.active_ind == True).one()\r
\r
+ elos = DBSession.query(PlayerElo).filter_by(player_id=player_id).\\r
+ filter(PlayerElo.game_type_cd.in_(['ctf','duel','dm'])).\\r
+ order_by(PlayerElo.elo.desc()).all()\r
+\r
+ elos_display = []\r
+ for elo in elos:\r
+ if elo.games > 32:\r
+ str = "{0} ({1})"\r
+ else:\r
+ str = "{0}* ({1})"\r
+\r
+ elos_display.append(str.format(round(elo.elo, 3),\r
+ elo.game_type_cd))\r
+\r
weapon_stats = DBSession.query("descr", "weapon_cd", "actual_total", \r
"max_total", "hit_total", "fired_total", "frags_total").\\r
from_statement(\r
\r
except Exception as e:\r
player = None\r
+ elos_display = None\r
weapon_stats = None\r
game_stats = None\r
recent_games = None\r
\r
return {'player':player, \r
+ 'elos_display':elos_display,\r
'recent_games':recent_games,\r
'weapon_stats':weapon_stats,\r
'game_stats':game_stats}\r