1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-27 13:34:28 +00:00

Telegram and Discord!

This commit is contained in:
Steffo 2018-07-25 23:52:38 +02:00
parent 7f40dbb338
commit ab641fc8a6
6 changed files with 73 additions and 12 deletions

View file

@ -590,9 +590,39 @@ nav {
}
.telegram {
font-family: "Lucida Sans Unicode", sans-serif;
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;
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 {
grid-column: 1;

BIN
static/whitney.woff Normal file

Binary file not shown.

View 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>

View file

@ -26,21 +26,31 @@
{% with record = ryg %}
{% include "minis/ryg.html" %}
{% 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 %}
{% with record = steam %}
{% include "minis/steam.html" %}
{% endwith %}
{% endif %}
{% if rl %}
{% with record = rl %}
{% include "minis/rl.html" %}
{% endwith %}
{% endif %}
{% if dota %}
{% with record = dota %}
{% include "minis/dota.html" %}
{% endwith %}
{% endif %}
{% if rl %}
{% with record = rl %}
{% include "minis/rl.html" %}
{% endwith %}
{% endif %}
{% if osu %}
{% with record = osu %}
{% include "minis/osu.html" %}
@ -56,10 +66,5 @@
{% include "minis/ow.html" %}
{% endwith %}
{% endif %}
{% if tg %}
{% with record = tg %}
{% include "minis/telegram.html" %}
{% endwith %}
{% endif %}
</div>
{% endblock %}

View file

@ -80,9 +80,10 @@ def page_profile(name: str):
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()
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()
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")
@ -194,6 +195,16 @@ def page_game(name: str):
elif name == "ryg":
game_name = "Royalnet"
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()
return render_template("game.html", minis=query, game_name=game_name, game_short_name=name, config=config)