mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
Telegram and Discord!
This commit is contained in:
parent
7f40dbb338
commit
ab641fc8a6
6 changed files with 73 additions and 12 deletions
|
@ -590,9 +590,39 @@ nav {
|
||||||
}
|
}
|
||||||
|
|
||||||
.telegram {
|
.telegram {
|
||||||
|
font-family: "Lucida Sans Unicode", sans-serif;
|
||||||
background-color: #32afed;
|
background-color: #32afed;
|
||||||
color: white !important;
|
border: 6px solid white;
|
||||||
|
padding: 12px;
|
||||||
|
color: black;
|
||||||
|
|
||||||
|
a, a:hover, a:active, a:visited {
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.player {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.useless-stuff {
|
||||||
|
grid-column: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.discord {
|
||||||
|
background-color: #7289da;
|
||||||
padding: 18px;
|
padding: 18px;
|
||||||
|
color: white;
|
||||||
|
font-family: "Whitney", sans-serif;
|
||||||
|
opacity: 0.8;
|
||||||
|
|
||||||
|
a, a:hover, a:active, a:visited {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.player-image {
|
||||||
|
border-radius: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
.useless-stuff {
|
.useless-stuff {
|
||||||
grid-column: 1;
|
grid-column: 1;
|
||||||
|
|
BIN
static/whitney.woff
Normal file
BIN
static/whitney.woff
Normal file
Binary file not shown.
15
templates/minis/discord.html
Normal file
15
templates/minis/discord.html
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
<style>
|
||||||
|
@font-face {
|
||||||
|
font-family: "Whitney";
|
||||||
|
src: url("{{ url_for('static', filename='whitney.woff') }}") format('woff');
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div class="game-panel">
|
||||||
|
<div class="game-grid discord">
|
||||||
|
<div class="player">
|
||||||
|
<img src="{{ record.avatar_url(size=64) }}" class="player-image">
|
||||||
|
<span class="player-name">{{ record }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="game-score useless-stuff">è su Discord!</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -26,21 +26,31 @@
|
||||||
{% with record = ryg %}
|
{% with record = ryg %}
|
||||||
{% include "minis/ryg.html" %}
|
{% include "minis/ryg.html" %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
{% if tg %}
|
||||||
|
{% with record = tg %}
|
||||||
|
{% include "minis/tg.html" %}
|
||||||
|
{% endwith %}
|
||||||
|
{% endif %}
|
||||||
|
{% if discord %}
|
||||||
|
{% with record = discord %}
|
||||||
|
{% include "minis/discord.html" %}
|
||||||
|
{% endwith %}
|
||||||
|
{% endif %}
|
||||||
{% if steam %}
|
{% if steam %}
|
||||||
{% with record = steam %}
|
{% with record = steam %}
|
||||||
{% include "minis/steam.html" %}
|
{% include "minis/steam.html" %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if rl %}
|
|
||||||
{% with record = rl %}
|
|
||||||
{% include "minis/rl.html" %}
|
|
||||||
{% endwith %}
|
|
||||||
{% endif %}
|
|
||||||
{% if dota %}
|
{% if dota %}
|
||||||
{% with record = dota %}
|
{% with record = dota %}
|
||||||
{% include "minis/dota.html" %}
|
{% include "minis/dota.html" %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if rl %}
|
||||||
|
{% with record = rl %}
|
||||||
|
{% include "minis/rl.html" %}
|
||||||
|
{% endwith %}
|
||||||
|
{% endif %}
|
||||||
{% if osu %}
|
{% if osu %}
|
||||||
{% with record = osu %}
|
{% with record = osu %}
|
||||||
{% include "minis/osu.html" %}
|
{% include "minis/osu.html" %}
|
||||||
|
@ -56,10 +66,5 @@
|
||||||
{% include "minis/ow.html" %}
|
{% include "minis/ow.html" %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if tg %}
|
|
||||||
{% with record = tg %}
|
|
||||||
{% include "minis/telegram.html" %}
|
|
||||||
{% endwith %}
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
13
webserver.py
13
webserver.py
|
@ -80,9 +80,10 @@ def page_profile(name: str):
|
||||||
lol = db_session.query(db.LeagueOfLegends).filter_by(royal=user).one_or_none()
|
lol = db_session.query(db.LeagueOfLegends).filter_by(royal=user).one_or_none()
|
||||||
ow = db_session.query(db.Overwatch).filter_by(royal=user).one_or_none()
|
ow = db_session.query(db.Overwatch).filter_by(royal=user).one_or_none()
|
||||||
tg = db_session.query(db.Telegram).filter_by(royal=user).one_or_none()
|
tg = db_session.query(db.Telegram).filter_by(royal=user).one_or_none()
|
||||||
|
discord = db_session.query(db.Discord).filter_by(royal=user).one_or_none()
|
||||||
db_session.close()
|
db_session.close()
|
||||||
return render_template("profile.html", ryg=user, css=css, osu=osu, rl=rl, dota=dota, lol=lol, steam=steam, ow=ow,
|
return render_template("profile.html", ryg=user, css=css, osu=osu, rl=rl, dota=dota, lol=lol, steam=steam, ow=ow,
|
||||||
tg=tg, config=config)
|
tg=tg, discord=discord, config=config)
|
||||||
|
|
||||||
|
|
||||||
@app.route("/login")
|
@app.route("/login")
|
||||||
|
@ -194,6 +195,16 @@ def page_game(name: str):
|
||||||
elif name == "ryg":
|
elif name == "ryg":
|
||||||
game_name = "Royalnet"
|
game_name = "Royalnet"
|
||||||
query = db_session.query(db.Royal).all()
|
query = db_session.query(db.Royal).all()
|
||||||
|
elif name == "tg":
|
||||||
|
game_name = "Telegram"
|
||||||
|
query = db_session.query(db.Telegram).all()
|
||||||
|
elif name == "discord":
|
||||||
|
game_name = "Discord"
|
||||||
|
# noinspection PyComparisonWithNone
|
||||||
|
query = db_session.query(db.Discord).filter(db.Discord.royal_id != None).all()
|
||||||
|
else:
|
||||||
|
abort(404)
|
||||||
|
return
|
||||||
db_session.close()
|
db_session.close()
|
||||||
return render_template("game.html", minis=query, game_name=game_name, game_short_name=name, config=config)
|
return render_template("game.html", minis=query, game_name=game_name, game_short_name=name, config=config)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue