mirror of
https://github.com/FAUSheppy/open-web-leaderboard.git
synced 2026-01-22 02:47:39 +01:00
implement simplistic round overview
This commit is contained in:
17
server.py
17
server.py
@@ -28,7 +28,24 @@ def prettifyMinMaxY(computedMin, computedMax):
|
||||
else:
|
||||
return (computedMin - 100, 4000)
|
||||
|
||||
@app.route("/round-info")
|
||||
def singleRound():
|
||||
'''Display info about a single round itdentified by it's timestamp'''
|
||||
|
||||
timestamp = flask.request.args.get("id")
|
||||
if not timestamp:
|
||||
return ("", 404)
|
||||
db = DatabaseConnection(app.config["DB_PATH"])
|
||||
r = db.getRoundByTimestamp(timestamp)
|
||||
r = db.calcRatingChanges(r)
|
||||
|
||||
if not r:
|
||||
return ("", 404)
|
||||
|
||||
return flask.render_template("single_round.html", r=r)
|
||||
|
||||
@app.route("/rounds-by-timestamp")
|
||||
@app.route("/rounds")
|
||||
def rounds():
|
||||
'''Show rounds played on the server'''
|
||||
|
||||
|
||||
Reference in New Issue
Block a user