Clean up player view, show more on player_index page.
authorAnt Zucaro <azucaro@gmail.com>
Fri, 29 Mar 2013 19:59:13 +0000 (15:59 -0400)
committerAnt Zucaro <azucaro@gmail.com>
Fri, 29 Mar 2013 19:59:13 +0000 (15:59 -0400)
xonstat/templates/player_index.mako
xonstat/views/player.py

index 38da288e530c35931e1528861b0aff1332bb36eb..a574d4c0aaf1b8c725b9c7474b90a0dfdd7f1970 100644 (file)
@@ -23,11 +23,13 @@ Player Index
     </form>
     <table class="table table-hover table-condensed">
       <tr>
+        <th style="width:100px;">Player ID</th>
         <th>Nick</th>
         <th class="create-dt">Joined</th>
       </tr>
     % for player in players:
       <tr>
+        <td>${player.player_id}</th>
         <td><a href="${request.route_url("player_info", id=player.player_id)}" title="Go to this player's info page">${player.nick_html_colors()|n}</a></th>
         <td><span class="abstime" data-epoch="${player.epoch()}" title="${player.create_dt.strftime('%a, %d %b %Y %H:%M:%S UTC')}">${player.joined_pretty_date()}</span></th>
       </tr>
index 2029aa7a84594207ffd1276307163fb8330f73ad..c023ba492c6bdebe3d4a033158467fbf199e28e7 100644 (file)
@@ -1,18 +1,13 @@
 import datetime
-import json
 import logging
 import pyramid.httpexceptions
-import re
 import sqlalchemy as sa
 import sqlalchemy.sql.functions as func
-import time
 from calendar import timegm
 from collections import namedtuple
-from pyramid.url import current_route_url
-from sqlalchemy import desc, distinct
-from webhelpers.paginate import Page, PageURL
+from webhelpers.paginate import Page
 from xonstat.models import *
-from xonstat.util import page_url, to_json, pretty_date, datetime_seconds, html_colors
+from xonstat.util import page_url, to_json, pretty_date, datetime_seconds
 from xonstat.views.helpers import RecentGame, recent_games_q
 
 log = logging.getLogger(__name__)
@@ -31,7 +26,7 @@ def player_index_data(request):
                 filter(sa.not_(Player.nick.like('Anonymous Player%'))).\
                 order_by(Player.player_id.desc())
 
-        players = Page(player_q, current_page, items_per_page=10, url=page_url)
+        players = Page(player_q, current_page, items_per_page=25, url=page_url)
 
     except Exception as e:
         players = None
@@ -184,7 +179,6 @@ def get_overall_stats(player_id):
 
     # to be indexed by game_type_cd
     overall_stats = {}
-    raw_overall = None
 
     for row in raw_stats:
         # individual gametype ratio calculations