<%namespace file="navlinks.mako" import="navlinks" />
<%block name="title">
- % if game_type_cd == 'dm':
- Deathmatch Rank Index
- % elif game_type_cd == 'duel':
- Duel Rank Index
- % elif game_type_cd == 'tdm':
- Team Deathmatch Rank Index
- % elif game_type_cd == 'ctf':
- Capture The Flag Rank Index
- % endif
+ ${game_type.descr} Rank Index
</%block>
<div class="row">
def _rank_index_data(request):
- if request.params.has_key('page'):
- current_page = request.params['page']
- else:
- current_page = 1
+ current_page = request.params.get("page", 1)
# game type whitelist
game_types_allowed = ["ca", "ctf", "dm", "duel", "ft", "ka", "tdm"]
filter(PlayerRank.game_type_cd==game_type_cd).\
order_by(PlayerRank.rank)
+ game_type = DBSession.query(GameType).\
+ filter(GameType.game_type_cd == game_type_cd).one()
+
ranks = Page(ranks_q, current_page, url=page_url)
if len(ranks) == 0:
return {
'ranks':ranks,
'game_type_cd':game_type_cd,
+ 'game_type': game_type,
}