From 2b2ddfe4bd90e586532d68867b63ef34ac3ef801 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 4 Jun 2018 13:13:59 +0200 Subject: [PATCH] =?UTF-8?q?=C3=A8=20il=20momento=20di=20giocare=20a=20worm?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db.py | 28 ++++++++++++++++++ static/nryg.less | 64 ++++++++++++++++++++++++++++++++++++++--- templates/minis/rl.html | 35 ++++++++++++++++++++++ templates/profile.html | 3 ++ webserver.py | 3 +- 5 files changed, 128 insertions(+), 5 deletions(-) create mode 100644 templates/minis/rl.html diff --git a/db.py b/db.py index f16d5964..85505711 100644 --- a/db.py +++ b/db.py @@ -251,6 +251,34 @@ class RocketLeague(Base): self.solo_std_rank = None self.solo_std_div = None + def solo_rank_image(self): + if self.single_rank is None: + rank = 0 + else: + rank = self.single_rank + return f"https://rocketleaguestats.com/assets/img/rocket_league/ranked/season_four/{rank}.png" + + def doubles_rank_image(self): + if self.doubles_rank is None: + rank = 0 + else: + rank = self.doubles_rank + return f"https://rocketleaguestats.com/assets/img/rocket_league/ranked/season_four/{rank}.png" + + def standard_rank_image(self): + if self.standard_rank is None: + rank = 0 + else: + rank = self.standard_rank + return f"https://rocketleaguestats.com/assets/img/rocket_league/ranked/season_four/{rank}.png" + + def solo_std_rank_image(self): + if self.solo_std_rank is None: + rank = 0 + else: + rank = self.solo_std_rank + return f"https://rocketleaguestats.com/assets/img/rocket_league/ranked/season_four/{rank}.png" + class Dota(Base): __tablename__ = "dota" diff --git a/static/nryg.less b/static/nryg.less index ac9fa9f0..4b4ea0c7 100644 --- a/static/nryg.less +++ b/static/nryg.less @@ -38,19 +38,20 @@ input[type="text"], input[type="password"] { } .game-panel { + display: grid; max-width: 400px; + position: relative; + border-radius: 10px; + height: 80px; } .osu { - display: grid; - position: relative; font-family: 'Exo 2', 'Helvetica Neue', 'Arial', sans-serif; font-style: italic; border: 8px solid #ffffff; - border-radius: 10px; color: #ffffff; padding: 10px; - grid-row-gap: 4px; + grid-row-gap: 5px; .background-image { position: absolute; @@ -128,4 +129,59 @@ input[type="text"], input[type="password"] { .pp { font-size: x-small; } +} + +.rl { + background-image: linear-gradient(to bottom,rgba(35,91,139,.5),rgba(16,54,84,.5)), + linear-gradient(to right,rgba(35,91,139,.7),rgba(16,54,84,.7)); + padding: 18px; + grid-row-gap: 5px; + + .player { + grid-row: 1; + grid-column-start: 1; + grid-column-end: 4; + font-size: large; + + a { + text-decoration: none; + } + + .player-image { + width: 32px; + height: 32px; + vertical-align: middle; + } + + .player-name { + vertical-align: middle; + } + } + + .game-title { + grid-row: 2; + font-size: smaller; + font-style: normal; + } + + .game-score { + grid-row: 3; + } + + .duel { + grid-column: 1; + } + + .doubles { + grid-column: 2; + } + + .standard { + grid-column: 3; + } + + .solostd { + grid-column: 4; + } + } \ No newline at end of file diff --git a/templates/minis/rl.html b/templates/minis/rl.html new file mode 100644 index 00000000..8fcec9a8 --- /dev/null +++ b/templates/minis/rl.html @@ -0,0 +1,35 @@ + +
+ +
+ DUELLO +
+
+ +
+
+ DOPPIO +
+
+ +
+
+ STANDARD +
+
+ +
+
+ SOLO STD +
+
+ +
+
\ No newline at end of file diff --git a/templates/profile.html b/templates/profile.html index 204e44a4..55e5b532 100644 --- a/templates/profile.html +++ b/templates/profile.html @@ -11,4 +11,7 @@ {% if osu %} {% include "minis/osu.html" %} {% endif %} + {% if rl %} + {% include "minis/rl.html" %} + {% endif %} {% endblock %} \ No newline at end of file diff --git a/webserver.py b/webserver.py index 290787a6..532d868c 100644 --- a/webserver.py +++ b/webserver.py @@ -33,7 +33,8 @@ def page_profile(name: str): abort(404) return osu = db_session.query(db.Osu).filter_by(royal=user).one_or_none() - return render_template("profile.html", royal=user, osu=osu) + rl = db_session.query(db.RocketLeague).join(db.Steam).filter_by(royal=user).one_or_none() + return render_template("profile.html", royal=user, osu=osu, rl=rl) @app.route("/login")