config.add_route(name="server_info", pattern="/server/{id}", view=server_info,
renderer='server_info.mako')
+ config.add_route(name="map_info", pattern="/map/{id}", view=map_info,
+ renderer='map_info.mako')
+
config.add_route(name="stats_submit", pattern="stats/submit",
view=stats_submit, renderer='index.jinja2')
--- /dev/null
+<%inherit file="base.mako"/>
+
+<%block name="title">
+% if gmap:
+Map Information for ${gmap.name} -
+% endif
+
+${parent.title()}
+</%block>
+
+
+% if gmap is None:
+<h2>Sorry, that map wasn't found!</h2>
+
+% else:
+<h2>Map Detail</h2>
+<ul>
+ <li>ID: ${gmap.map_id}</li>
+ <li>Name: ${gmap.name}</li>
+ <li>PK3 Name: ${gmap.pk3_name}</li>
+ <li>Curl URL: ${gmap.curl_url}</li>
+</ul>
+% endif
return {'server':server}
+##########################################################################
+# This is the map views area - only views pertaining to Xonotic
+# maps and their related information goes here
+##########################################################################
+def map_info(request):
+ map_id = request.matchdict['id']
+ try:
+ gmap = DBSession.query(Map).filter_by(map_id=map_id).one()
+ except:
+ gmap = None
+ return {'gmap':gmap}
+
+
##########################################################################
# This is the stats views area - only views pertaining to Xonotic
# statistics and its related information goes here
'S' not in game_meta:
log.debug("Required game meta fields (T, G, M, or S) missing. "\
"Can't continue.")
- return {'msg':'Error processing the request.'}
+ raise Exception
server = get_or_create_server(session=session, name=game_meta['S'])
gmap = get_or_create_map(session=session, name=game_meta['M'])