The best flag capture time for each player is shown in the game
info page now. This only happens for CTF. The format shown is
seconds.milliseconds, with up to two decimal places shown.
+% if len(captimes) > 0:
+<div class="row">
+ <div class="span6">
+ <h3>Best Flag Capture Times</h3>
+ <table class="table table-bordered table-condensed">
+ <thead>
+ <tr>
+ <th>Nick</th>
+ <th>Captime</th>
+ </tr>
+ </thead>
+ <tbody>
+ % for pgs in captimes:
+ <tr>
+ <td>
+ % if pgs.player_id > 2:
+ <a href="${request.route_url("player_info", id=pgs.player_id)}"
+ title="Go to the info page for this player">
+ <span class="nick">${pgs.nick_html_colors()|n}</span>
+ </a>
+ % else:
+ <span class="nick">${pgs.nick_html_colors()|n}</span>
+ % endif
+ </td>
+ <td>${round(float(pgs.fastest_cap.seconds) + (pgs.fastest_cap.microseconds/1000000.0), 2)}</td>
+ </tr>
+ % endfor
+ </tbody>
+ </table>
+ </div>
+</div>
+% endif
+
+
% if len(pgstats) > 0:
<div class="row">
<div class="span12">
% if len(pgstats) > 0:
<div class="row">
<div class="span12">
order_by(PlayerGameStat.score).\
all()
order_by(PlayerGameStat.score).\
all()
- # mako is an absolute bastard when dealing with decimals, so...
- for pgstat in pgstats:
- try:
- pgstat.elo_delta = "{0:+4.2f}".format(float(pgstat.elo_delta))
- except:
- pgstat.elo_delta = "0.00"
+ captimes = []
+ if game.game_type_cd == 'ctf':
+ for pgstat in pgstats:
+ if pgstat.fastest_cap is not None:
+ captimes.append(pgstat)
+
+ captimes = sorted(captimes, key=lambda x:x.fastest_cap)
pwstats = {}
for (pwstat, pgstat, weapon) in DBSession.query(PlayerWeaponStat, PlayerGameStat, Weapon).\
pwstats = {}
for (pwstat, pgstat, weapon) in DBSession.query(PlayerWeaponStat, PlayerGameStat, Weapon).\
map = None
pgstats = None
pwstats = None
map = None
pgstats = None
pwstats = None
raise inst
return {'game':game,
raise inst
return {'game':game,
'map':map,
'pgstats':pgstats,
'pwstats':pwstats,
'map':map,
'pgstats':pgstats,
'pwstats':pwstats,