session.key = xonstat
session.secret = 433fa4b080c2147c79c0ed1cb54e3ce81371fb34
jinja2.directories = xonstat:templates
+mako.directories = xonstat:templates
[pipeline:main]
pipeline =
config.add_static_view('static', 'xonstat:static')
+ # routes
config.add_route(name="main_index", pattern="/", view=main_index,
renderer='index.jinja2')
+
+ config.add_route(name="player_info", pattern="/player/{id}", view=player_info,
+ renderer='player_info.mako')
+
+ config.add_route(name="game_info", pattern="/game/{id}", view=game_info,
+ renderer='game_info.mako')
+
config.add_route(name="stats_submit", pattern="stats/submit",
view=stats_submit, renderer='index.jinja2')
--- /dev/null
+<html>
+ <head>
+ <title><%block name="title">XonStat - The Xonotic Statistics Database</%block></title>
+ <%block name="css"/>
+ <%block name="js"/>
+ </head>
+ <body>
+ <div id="header">
+ <%block name="header"/>
+ </div>
+
+ ${self.body()}
+
+ <div id="footer">
+ <%block name="footer"/>
+ </div>
+ </body>
+</html>
--- /dev/null
+<%inherit file="base.mako"/>
+
+<%block name="title">
+Game Information - ${parent.title()}
+</%block>
+
+
+% if game is None:
+<h2>Sorry, that game wasn't found!</h2>
+
+% else:
+<h2>Game Detail</h2>
+<ul>
+ <li>ID: ${game.game_id}</li>
+ <li>Time: ${game.start_dt}</li>
+ <li>Game Type: ${game.game_type_cd}</li>
+ <li>Server: ${game.server_id}</li>
+ <li>Map: ${game.map_id}</li>
+ <li>Duration: ${game.duration}</li>
+ <li>Winner: ${game.duration}</li>
+</ul>
+% endif
--- /dev/null
+<%inherit file="base.mako"/>
+
+<%block name="title">
+% if player:
+Player Information for ${player.nick} -
+% endif
+
+${parent.title()}
+</%block>
+
+
+% if player is None:
+<h2>Sorry, that player wasn't found!</h2>
+
+% else:
+<h2>Player Detail</h2>
+<ul>
+ <li>Nickname: ${player.nick}</li>
+ <li>ID: ${player.player_id}</li>
+ <li>Location: ${player.location}</li>
+ <li>Joined: ${player.create_dt}</li>
+</ul>
+% endif
@view_config(renderer='player_info.mako')
def player_info(request):
- player = DBSession.query(Player).filter_by(player_id=p_player_id)
- log.debug("testing logging; entered PlayerHandler.info()")
+ player_id = request.matchdict['id']
+ try:
+ player = DBSession.query(Player).filter_by(player_id=player_id).one()
+ except:
+ player = None
+ log.debug("entered player_info")
return {'player':player}
+
+##########################################################################
+# This is the game views area - only views pertaining to Xonotic
+# games and their related information goes here
+##########################################################################
+def game_info(request):
+ game_id = request.matchdict['id']
+ try:
+ game = DBSession.query(Game).filter_by(game_id=game_id).one()
+ except:
+ game = None
+ log.debug("entered game_info")
+ return {'game':game}
+
+
##########################################################################
# This is the stats views area - only views pertaining to Xonotic
# statistics and its related information goes here