From f1081cb8b705cb18526d7d4fe60cbd9926e0e678 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 2 Feb 2018 11:46:27 +0100 Subject: [PATCH] Stuff --- templates/challenge1.html | 24 ++++++++++++++++++++++++ templates/leaderboards.html | 6 +++--- webserver.py | 7 +++++++ 3 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 templates/challenge1.html diff --git a/templates/challenge1.html b/templates/challenge1.html new file mode 100644 index 00000000..1b73d32e --- /dev/null +++ b/templates/challenge1.html @@ -0,0 +1,24 @@ + + + + + + Challenge 1 - RYG + + + + +
+

+ La Sfida di questa settimana +

+

+ Raggiungiamo i {{ target }}pp di gruppo su osu! +

+
+
+
+
+ + \ No newline at end of file diff --git a/templates/leaderboards.html b/templates/leaderboards.html index 304a5bd5..5607ae7b 100644 --- a/templates/leaderboards.html +++ b/templates/leaderboards.html @@ -38,12 +38,12 @@ {{ record.wins }}
- {% if record.rank_tier is not None %} + {% if record.rank_tier is not none %} {% if record.get_rank_stars_url() %}{% endif %} {% endif %} - {% if record.rank_tier is not None and record.rank_tier < 10 %} + {% if record.rank_tier is not none and record.rank_tier < 10 %} Unranked - {% else %} + {% elif record.rank_tier >= 10 %} {{ record.get_rank_name() }} {{ record.get_rank_number() }} {% endif %}
diff --git a/webserver.py b/webserver.py index 02d0680d..fd432b5b 100644 --- a/webserver.py +++ b/webserver.py @@ -28,6 +28,13 @@ def page_leaderboards(): session.close() return render_template("leaderboards.html", dota_data=dota_data, rl_data=rl_data, ow_data=ow_data, osu_data=osu_data, lol_data=lol_data) +@app.route("/challenge/1") +def page_challenge_one(): + session = Session() + result = session.execute(r"SELECT sum(osu.std_pp) + sum(osu.taiko_pp) + sum(osu.catch_pp) + sum(osu.mania_pp) total_pp FROM osu;") + session.close() + return render_template("challenge1.html", starting=4959.518703999999, result=result, target=5200) + if __name__ == "__main__": try: