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:
parent
51494c2ad7
commit
7f40dbb338
13 changed files with 132 additions and 69 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -20,15 +20,15 @@ h1, h2, h3, h4, h5, h6 {
|
|||
a {
|
||||
color: @link-color;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover, a:active {
|
||||
&:hover, &:active {
|
||||
color: @link-color;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
a:visited {
|
||||
&: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 {
|
||||
|
|
|
@ -12,9 +12,11 @@
|
|||
<h1>
|
||||
Royal Games su {{ game_name }}
|
||||
</h1>
|
||||
<div class="game-panels">
|
||||
{% for mini in minis %}
|
||||
{% with record = mini %}
|
||||
{% include "minis/" + game_short_name + ".html" %}
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
12
templates/minis/telegram.html
Normal file
12
templates/minis/telegram.html
Normal 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>
|
|
@ -22,6 +22,7 @@
|
|||
<h1>
|
||||
Profilo di {{ ryg.username }} {% if session.get('user_id', '') == ryg.id %}<a href="/setcss" id="edit-css">Modifica</a>{% endif %}
|
||||
</h1>
|
||||
<div class="game-panels">
|
||||
{% with record = ryg %}
|
||||
{% include "minis/ryg.html" %}
|
||||
{% endwith %}
|
||||
|
@ -55,4 +56,10 @@
|
|||
{% include "minis/ow.html" %}
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
{% if tg %}
|
||||
{% with record = tg %}
|
||||
{% include "minis/telegram.html" %}
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue