diff --git a/static/beaufortlol.woff b/static/beaufortlol.woff new file mode 100644 index 00000000..59ecd6e6 Binary files /dev/null and b/static/beaufortlol.woff differ diff --git a/static/nryg.less b/static/nryg.less index e30c0536..92fa310b 100644 --- a/static/nryg.less +++ b/static/nryg.less @@ -43,7 +43,7 @@ input[type="text"], input[type="password"] { .game-grid { display: grid; - width: 400px; + width: 360px; height: 100px; border-radius: 10px; margin: 4px; @@ -202,7 +202,7 @@ input[type="text"], input[type="password"] { padding: 15px; border: 3px solid #000000; grid-row-gap: 5px; - grid-template-columns: 20% 80%; + grid-template-columns: 25% 75%; background-image: linear-gradient(to bottom, #440b0b, #631013); color: #ffffff; @@ -269,4 +269,64 @@ input[type="text"], input[type="password"] { height: 44px; } } +} + +.lol { + font-family: "BeaufortLoL", "Times New Roman", serif; + padding: 15px; + color: #c9aa71; + border: 3px solid #463714; + background-color: #010a13; + 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; + border-radius: 16px; + } + } + + .level { + grid-column: 1; + font-size: x-large; + } + + .soloq { + grid-column: 2; + } + + .flexq { + grid-column: 3; + } + + .twtrq { + grid-column: 4; + } + + .title { + grid-row: 2; + font-size: x-small; + text-align: center; + } + + .value { + grid-row: 3; + text-align: center; + margin: auto; + } + + .rank { + height: 40px; + } } \ No newline at end of file diff --git a/telegrambot.py b/telegrambot.py index cb858ee5..08329850 100644 --- a/telegrambot.py +++ b/telegrambot.py @@ -391,6 +391,18 @@ def cmd_ship(bot: Bot, update: Update): f" {mixed.capitalize()}") +def cmd_profile(bot: Bot, update: Update): + session = db.Session() + user = session.query(db.Telegram).filter_by(telegram_id=update.message.from_user.id).join(db.Royal).one_or_none() + session.close() + if user is None: + bot.send_message(update.message.chat.id, "⚠ Non sei connesso a Royalnet!\n" + "Per registrarti, utilizza il comando /register.") + return + bot.send_message(update.message.chat.id, "👤 [Profilo di {user.royals.username}]" + "(https://ryg.steffo.eu/profile/{user.royals.username})") + + def process(arg_discord_connection): print("Telegrambot starting...") if arg_discord_connection is not None: @@ -411,6 +423,7 @@ def process(arg_discord_connection): u.dispatcher.add_handler(CommandHandler("ban", cmd_ban)) u.dispatcher.add_handler(CommandHandler("eat", cmd_eat)) u.dispatcher.add_handler(CommandHandler("ship", cmd_ship)) + u.dispatcher.add_handler(CommandHandler("profile", cmd_profile)) u.dispatcher.add_handler(CallbackQueryHandler(on_callback_query)) u.bot.send_message(config["Telegram"]["main_group"], f"ℹ Royal Bot avviato e pronto a ricevere comandi!\n" diff --git a/templates/base.html b/templates/base.html index 23982424..90d64c61 100644 --- a/templates/base.html +++ b/templates/base.html @@ -2,6 +2,7 @@ + {% block pagetitle %}{% endblock %} - Royal Games {% block prehead %}{% endblock %} diff --git a/templates/minis/lol.html b/templates/minis/lol.html new file mode 100644 index 00000000..b7dd7f5f --- /dev/null +++ b/templates/minis/lol.html @@ -0,0 +1,50 @@ + +
+
+
+ + {{ lol.summoner_name }} +
+
+ LIVELLO +
+
+ {{ lol.level }} +
+
+ SOLO/DUO +
+
+ {% if lol.solo_division is none %} + + {% else %} + + {% endif %} +
+
+ FLEX +
+
+ {% if lol.flex_division is none %} + + {% else %} + + {% endif %} +
+
+ 3V3 +
+
+ {% if lol.twtr_division is none %} + + {% else %} + + {% endif %} +
+
+
\ No newline at end of file diff --git a/templates/minis/rl.html b/templates/minis/rl.html index 55de0a9f..50856cc7 100644 --- a/templates/minis/rl.html +++ b/templates/minis/rl.html @@ -1,3 +1,6 @@ +
diff --git a/templates/profile.html b/templates/profile.html index 3b6fc91a..5ed951af 100644 --- a/templates/profile.html +++ b/templates/profile.html @@ -17,4 +17,7 @@ {% if dota %} {% include "minis/dota.html" %} {% endif %} + {% if lol %} + {% include "minis/lol.html" %} + {% endif %} {% endblock %} \ No newline at end of file diff --git a/webserver.py b/webserver.py index 5a8a9684..387dbd98 100644 --- a/webserver.py +++ b/webserver.py @@ -35,7 +35,9 @@ def page_profile(name: str): osu = db_session.query(db.Osu).filter_by(royal=user).one_or_none() rl = db_session.query(db.RocketLeague).join(db.Steam).filter_by(royal=user).one_or_none() dota = db_session.query(db.Dota).join(db.Steam).filter_by(royal=user).one_or_none() - return render_template("profile.html", royal=user, osu=osu, rl=rl, dota=dota) + lol = db_session.query(db.LeagueOfLegends).filter_by(royal=user).one_or_none() + db_session.close() + return render_template("profile.html", royal=user, osu=osu, rl=rl, dota=dota, lol=lol) @app.route("/login")