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

Fix annoying misalign in game and profile pages

This commit is contained in:
Steffo 2018-07-25 21:10:43 +02:00
parent 51494c2ad7
commit 7f40dbb338
13 changed files with 132 additions and 69 deletions

View file

@ -8,7 +8,6 @@ import sys
import db
import youtube_dl
import concurrent.futures
import stagismo
import platform
import typing
import os
@ -17,8 +16,8 @@ import configparser
import subprocess
import async_timeout
import raven
import cast
import logging
import errors
logging.basicConfig()
@ -472,6 +471,27 @@ async def cmd_dump_voice_player_error(channel: discord.Channel, author: discord.
await client.send_message(channel, f"```\n{str(voice_player.error)}\n```")
@command
async def cmd_register(channel: discord.Channel, author: discord.Member, params: typing.List[str]):
session = await loop.run_in_executor(executor, db.Session())
if len(params) < 1:
await client.send_message(channel, "⚠️ Non hai specificato un username!\n"
"Sintassi corretta: `!register <username_ryg>`")
return
try:
d = db.Discord.create(session,
royal_username=params[0],
discord_user=author)
except errors.AlreadyExistingError:
await client.send_message(channel,
"⚠ Il tuo account Discord è già collegato a un account RYG "
"o l'account RYG che hai specificato è già collegato a un account Discord.")
return
session.add(d)
session.commit()
session.close()
await client.send_message(channel, "✅ Sincronizzazione completata!")
async def queue_predownload_videos():
while True:
for index, video in enumerate(voice_queue[:int(config["YouTube"]["predownload_videos"])].copy()):
@ -551,7 +571,8 @@ commands = {
"!q": cmd_queue,
"!shuffle": cmd_shuffle,
"!clear": cmd_clear,
"!dump_vp": cmd_dump_voice_player_error
"!dump_vp": cmd_dump_voice_player_error,
"!register": cmd_register
}

View file

@ -20,15 +20,15 @@ h1, h2, h3, h4, h5, h6 {
a {
color: @link-color;
text-decoration: none;
}
a:hover, a:active {
color: @link-color;
text-decoration: underline;
}
&:hover, &:active {
color: @link-color;
text-decoration: underline;
}
a:visited {
color: @visited-color;
&:visited {
color: @visited-color;
}
}
blockquote {
@ -162,8 +162,31 @@ nav {
}
}
@media (min-width:601px) {
.mobile-only {
display: none;
}
}
@media (max-width:600px) {
.desktop-only {
display: none;
}
}
//Dirtiest hack ever
.game-panels {
font-size: 0;
.game-panel {
font-size: medium;
}
}
.game-panel {
display: inline-block;
margin: 4px;
vertical-align: top;
}
.game-grid {
@ -171,7 +194,6 @@ nav {
width: 360px;
height: 100px;
border-radius: 10px;
margin: 4px;
position: relative;
.game-title {
@ -199,18 +221,6 @@ nav {
}
}
@media (min-width:601px) {
.mobile-only {
display: none;
}
}
@media (max-width:600px) {
.desktop-only {
display: none;
}
}
.osu {
font-family: 'Exo 2', 'Helvetica Neue', 'Arial', sans-serif;
font-style: italic;
@ -489,7 +499,7 @@ nav {
}
.ow {
padding: 15px;
padding: 16px;
font-family: "FuturaNo2D", sans-serif;
background-color: #371b00;
border: 2px solid #ff9c00;
@ -579,6 +589,16 @@ nav {
}
}
.telegram {
background-color: #32afed;
color: white !important;
padding: 18px;
.useless-stuff {
grid-column: 1;
}
}
.wiki {
.wiki-log {

View file

@ -12,9 +12,11 @@
<h1>
Royal Games su {{ game_name }}
</h1>
{% for mini in minis %}
{% with record = mini %}
{% include "minis/" + game_short_name + ".html" %}
{% endwith %}
{% endfor %}
<div class="game-panels">
{% for mini in minis %}
{% with record = mini %}
{% include "minis/" + game_short_name + ".html" %}
{% endwith %}
{% endfor %}
</div>
{% endblock %}

View file

@ -33,4 +33,4 @@
{% endif %}
</div>
</div>
</div>
</div>

View file

@ -47,4 +47,4 @@
{% endif %}
</div>
</div>
</div>
</div>

View file

@ -33,4 +33,4 @@
<span class="number">{{ record.mania_pp | int }}</span><span class="pp">pp</span>
</div>
</div>
</div>
</div>

View file

@ -30,4 +30,4 @@
{% endif %}
</div>
</div>
</div>
</div>

View file

@ -34,4 +34,4 @@
<img src="{{ record.solo_std_rank_image() }}" title="{{ record.solo_std_mmr }} MMR">
</div>
</div>
</div>
</div>

View file

@ -13,4 +13,4 @@
{{ record.fiorygi }}
</div>
</div>
</div>
</div>

View file

@ -42,4 +42,4 @@
</a>
{% endif %}
</div>
</div>
</div>

View file

@ -0,0 +1,12 @@
<div class="game-panel">
<div class="game-grid telegram">
<div class="player">
{% if record.username is none %}
<span class="player-name">{{ record.first_name }}</span>
{% else %}
<a href="https://t.me/{{ record.username }}" class="player-name">@{{ record.username }}</a>
{% endif %}
</div>
<div class="game-score useless-stuff">è su Telegram!</div>
</div>
</div>

View file

@ -22,37 +22,44 @@
<h1>
Profilo di {{ ryg.username }} {% if session.get('user_id', '') == ryg.id %}<a href="/setcss" id="edit-css">Modifica</a>{% endif %}
</h1>
{% with record = ryg %}
{% include "minis/ryg.html" %}
{% endwith %}
{% if steam %}
{% with record = steam %}
{% include "minis/steam.html" %}
<div class="game-panels">
{% with record = ryg %}
{% include "minis/ryg.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 osu %}
{% with record = osu %}
{% include "minis/osu.html" %}
{% endwith %}
{% endif %}
{% if lol %}
{% with record = lol %}
{% include "minis/lol.html" %}
{% endwith %}
{% endif %}
{% if ow %}
{% with record = ow %}
{% include "minis/ow.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 osu %}
{% with record = osu %}
{% include "minis/osu.html" %}
{% endwith %}
{% endif %}
{% if lol %}
{% with record = lol %}
{% include "minis/lol.html" %}
{% endwith %}
{% endif %}
{% if ow %}
{% with record = ow %}
{% include "minis/ow.html" %}
{% endwith %}
{% endif %}
{% if tg %}
{% with record = tg %}
{% include "minis/telegram.html" %}
{% endwith %}
{% endif %}
</div>
{% endblock %}

View file

@ -79,9 +79,10 @@ def page_profile(name: str):
dota = db_session.query(db.Dota).join(db.Steam).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()
tg = db_session.query(db.Telegram).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,
config=config)
tg=tg, config=config)
@app.route("/login")