1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

More small website improvements

This commit is contained in:
Steffo 2019-01-03 14:13:23 +01:00
parent 1e9d244248
commit bb4d116aac
10 changed files with 58 additions and 40 deletions

16
db.py
View file

@ -650,6 +650,22 @@ class Overwatch(Base):
n = 7 n = 7
return f"https://d1u1mce87gyfbn.cloudfront.net/game/rank-icons/season-2/rank-{n}.png" return f"https://d1u1mce87gyfbn.cloudfront.net/game/rank-icons/season-2/rank-{n}.png"
def rank_name(self):
if self.rank < 1500:
return "Bronze"
elif self.rank < 2000:
return "Silver"
elif self.rank < 2500:
return "Gold"
elif self.rank < 3000:
return "Platinum"
elif self.rank < 3500:
return "Diamond"
elif self.rank < 4000:
return "Master"
else:
return "Grandmaster"
class Diario(Base): class Diario(Base):
__tablename__ = "diario" __tablename__ = "diario"

View file

@ -564,7 +564,7 @@ table {
grid-column: 2; grid-column: 2;
text-align: right; text-align: right;
img { .game-image {
height: 58px; height: 58px;
border-radius: 4px; border-radius: 4px;
} }

View file

@ -11,12 +11,14 @@
<p> <p>
Il server è crashato mentre cercava di generare questa pagina. Oops. Il server è crashato mentre cercava di generare questa pagina. Oops.
</p> </p>
<p>
<blockquote> <blockquote>
<p> <p>
I am sorry, unknown error occured during working with your request, Admin were notified I am sorry, unknown error occured during working with your request, Admin were notified
</p> </p>
</blockquote> </blockquote>
<i>@OcteonRygBot, 2017</i> <p>
L'errore <i>dovrebbe</i> essere stato segnalato a Steffo.
Se riesci e ne hai voglia, spiegagli anche cosa ha provocato l'errore.
</p> </p>
<i>@OcteonRygBot, 2017</i>
{% endblock %} {% endblock %}

View file

@ -32,7 +32,7 @@
</div> </div>
<div class="lower-box"> <div class="lower-box">
{% include "components/diarioentry.html" %} {% include "components/diarioentry.html" %}
<a href="/diario">Visualizza tutto</a> <a href="{{ url_for("page_diario") }}">Visualizza tutto</a>
</div> </div>
</div> </div>
{% include "components/wikibox.html" %} {% include "components/wikibox.html" %}
@ -58,7 +58,7 @@
<li><a href="https://new.reddit.com/r/RoyalGames/">/r/RoyalGames</a></li> <li><a href="https://new.reddit.com/r/RoyalGames/">/r/RoyalGames</a></li>
<li><a href="{{ url_for("page_music") }}">Statistiche su Royal Music</a></li> <li><a href="{{ url_for("page_music") }}">Statistiche su Royal Music</a></li>
<li><a href="http://amazon.steffo.eu/royal-music-cache/">File in cache di Royal Music</a></li> <li><a href="http://amazon.steffo.eu/royal-music-cache/">File in cache di Royal Music</a></li>
<li><a href="/activity">Statistiche sull'attività</a></li> <li><a href="{{ url_for("page_activity") }}">Statistiche sull'attività</a></li>
</ul> </ul>
</div> </div>
</div> </div>
@ -80,15 +80,15 @@
</div> </div>
<div class="lower-box"> <div class="lower-box">
<ul> <ul>
<li><a href="/game/ryg">Royal Games</a></li> <li><a href="{{ url_for("page_game", name="ryg") }}">Royal Games</a></li>
<li><a href="/game/halloween">Halloween 2018</a></li> <li><a href="{{ url_for("page_game", name="halloween") }}">Halloween 2018</a></li>
<li><a href="/game/tg">Telegram</a></li> <li><a href="{{ url_for("page_game", name="tg") }}">Telegram</a></li>
<li><a href="/game/discord">Discord</a></li> <li><a href="{{ url_for("page_game", name="discord") }}">Discord</a></li>
<li><a href="/game/steam">Steam</a></li> <li><a href="{{ url_for("page_game", name="steam") }}">Steam</a></li>
<li><a href="/game/dota">Dota 2</a></li> <li><a href="{{ url_for("page_game", name="dota") }}">Dota 2</a></li>
<li><a href="/game/lol">League of Legends</a></li> <li><a href="{{ url_for("page_game", name="lol") }}">League of Legends</a></li>
<li><a href="/game/ow">Overwatch</a></li> <li><a href="{{ url_for("page_game", name="ow") }}">Overwatch</a></li>
<li><a href="/game/osu">osu!</a></li> <li><a href="{{ url_for("page_game", name="osu") }}">osu!</a></li>
</ul> </ul>
</div> </div>
</div> </div>

View file

@ -7,7 +7,7 @@
<div class="game-panel"> <div class="game-panel">
<div class="game-grid discord"> <div class="game-grid discord">
<div class="player"> <div class="player">
<img src="https://cdn.discordapp.com/avatars/{{ record["discord_id"] }}/{{ record["avatar_hex"] }}" class="player-image"> <img src="https://cdn.discordapp.com/avatars/{{ record["discord_id"] }}/{{ record["avatar_hex"] }}" class="player-image" alt="">
<span class="player-name">{{ record["name"] }}#{{ record["discriminator"] }}</span> <span class="player-name">{{ record["name"] }}#{{ record["discriminator"] }}</span>
</div> </div>
{% if record["last_song"] %} {% if record["last_song"] %}

View file

@ -10,7 +10,7 @@
<div class="game-grid dota"> <div class="game-grid dota">
<div class="player"> <div class="player">
<a href="https://www.opendota.com/players/{{ record.steam.to_steam_id_3(record.steam.steam_id) }}"> <a href="https://www.opendota.com/players/{{ record.steam.to_steam_id_3(record.steam.steam_id) }}">
<img src="{{ record.steam.avatar_url() }}" class="player-image"> <img src="{{ record.steam.avatar_url() }}" class="player-image" alt="">
<span class="player-name">{{ record.steam.persona_name }}</span> <span class="player-name">{{ record.steam.persona_name }}</span>
</a> </a>
</div> </div>
@ -22,13 +22,13 @@
</div> </div>
<div class="rank"> <div class="rank">
{% if record.rank_tier is none %} {% if record.rank_tier is none %}
<img class="medal" src="https://www.opendota.com/assets/images/dota2/rank_icons/rank_icon_0.png"> <img class="medal" src="https://www.opendota.com/assets/images/dota2/rank_icons/rank_icon_0.png" alt="">
<span class="text">Non classificato</span> <span class="text">Non classificato</span>
{% elif record.rank_tier < 10 %} {% elif record.rank_tier < 10 %}
<img class="medal" src="https://www.opendota.com/assets/images/dota2/rank_icons/rank_icon_0.png"> <img class="medal" src="https://www.opendota.com/assets/images/dota2/rank_icons/rank_icon_0.png" alt="">
<span class="text">{{ record.rank_tier }} piazzamenti completati</span> <span class="text">{{ record.rank_tier }} piazzamenti completati</span>
{% else %} {% else %}
<img class="medal" src="{{ record.get_rank_icon_url() }}">{% if record.get_rank_stars_url() %}<img class="stars" src="{{ record.get_rank_stars_url() }}">{% endif %} <img class="medal" src="{{ record.get_rank_icon_url() }}" alt="">{% if record.get_rank_stars_url() %}<img class="stars" src="{{ record.get_rank_stars_url() }}" alt="">{% endif %}
<span class="text">{{ record.get_rank_name() }}[{{ record.get_rank_number() }}]</span> <span class="text">{{ record.get_rank_name() }}[{{ record.get_rank_number() }}]</span>
{% endif %} {% endif %}
</div> </div>

View file

@ -7,7 +7,7 @@
<div class="game-panel"> <div class="game-panel">
<div class="game-grid lol"> <div class="game-grid lol">
<div class="player"> <div class="player">
<img src="http://avatar.leagueoflegends.com/EUW1/{{ record.summoner_name }}.png" class="player-image"> <img src="http://avatar.leagueoflegends.com/EUW1/{{ record.summoner_name }}.png" class="player-image" alt="">
<span class="player-name">{{ record.summoner_name }}</span> <span class="player-name">{{ record.summoner_name }}</span>
</div> </div>
<div class="game-title level"> <div class="game-title level">
@ -21,7 +21,7 @@
</div> </div>
<div class="game-score mastery"> <div class="game-score mastery">
{% if record.highest_mastery_champ %} {% if record.highest_mastery_champ %}
<img src="{{ record.highest_mastery_champ_image() }}" title="{{ record.highest_mastery_champ_name() }}" class="rank"> <img src="{{ record.highest_mastery_champ_image() }}" title="{{ record.highest_mastery_champ_name() }}" alt="{{ record.highest_mastery_champ_name() }}" class="rank">
{% endif %} {% endif %}
</div> </div>
<div class="game-title soloq"> <div class="game-title soloq">
@ -29,9 +29,9 @@
</div> </div>
<div class="game-score soloq"> <div class="game-score soloq">
{% if record.solo_division is none %} {% if record.solo_division is none %}
<img src="{{ url_for('static', filename='lol-rank-icons/provisional.png') }}" title="Non classificato" class="rank"> <img src="{{ url_for('static', filename='lol-rank-icons/provisional.png') }}" title="Non classificato" alt="Non classificato" class="rank">
{% else %} {% else %}
<img src="{{ url_for('static', filename='lol-rank-icons/' + record.solo_division.name|lower + ".png") }}" class="rank" title="{{ record.solo_division.name|capitalize }} {{ record.solo_rank.name }}"> <img src="{{ url_for('static', filename='lol-rank-icons/' + record.solo_division.name|lower + ".png") }}" class="rank" title="{{ record.solo_division.name|capitalize }} {{ record.solo_rank.name }}" alt="{{ record.solo_division.name|capitalize }} {{ record.solo_rank.name }}">
{% endif %} {% endif %}
</div> </div>
<div class="game-title flexq"> <div class="game-title flexq">
@ -39,9 +39,9 @@
</div> </div>
<div class="game-score flexq"> <div class="game-score flexq">
{% if record.flex_division is none %} {% if record.flex_division is none %}
<img src="{{ url_for('static', filename='lol-rank-icons/provisional.png') }}" title="Non classificato" class="rank"> <img src="{{ url_for('static', filename='lol-rank-icons/provisional.png') }}" title="Non classificato" alt="Non classificato" class="rank">
{% else %} {% else %}
<img src="{{ url_for('static', filename='lol-rank-icons/' + record.flex_division.name|lower + ".png") }}" class="rank" title="{{ record.flex_division.name|capitalize }} {{ record.flex_rank.name }}"> <img src="{{ url_for('static', filename='lol-rank-icons/' + record.flex_division.name|lower + ".png") }}" class="rank" title="{{ record.flex_division.name|capitalize }} {{ record.flex_rank.name }}" alt="{{ record.flex_division.name|capitalize }} {{ record.flex_rank.name }}">
{% endif %} {% endif %}
</div> </div>
<div class="game-title twtrq"> <div class="game-title twtrq">
@ -49,9 +49,9 @@
</div> </div>
<div class="game-score twtrq"> <div class="game-score twtrq">
{% if record.twtr_division is none %} {% if record.twtr_division is none %}
<img src="{{ url_for('static', filename='lol-rank-icons/provisional.png') }}" title="Non classificato" class="rank"> <img src="{{ url_for('static', filename='lol-rank-icons/provisional.png') }}" title="Non classificato" alt="Non classificato" class="rank">
{% else %} {% else %}
<img src="{{ url_for('static', filename='lol-rank-icons/' + record.twtr_division.name|lower + ".png") }}" class="rank" title="{{ record.twtr_division.name|capitalize }} {{ record.twtr_rank.name }}"> <img src="{{ url_for('static', filename='lol-rank-icons/' + record.twtr_division.name|lower + ".png") }}" class="rank" title="{{ record.twtr_division.name|capitalize }} {{ record.twtr_rank.name }}" alt="{{ record.twtr_division.name|capitalize }} {{ record.twtr_rank.name }}">
{% endif %} {% endif %}
</div> </div>
</div> </div>

View file

@ -4,30 +4,30 @@
<div class="background-color"></div> <div class="background-color"></div>
<div class="player"> <div class="player">
<a href="https://osu.ppy.sh/users/{{ record.osu_id }}"> <a href="https://osu.ppy.sh/users/{{ record.osu_id }}">
<img src="https://a.ppy.sh/{{ record.osu_id }}" class="player-image"> <img src="https://a.ppy.sh/{{ record.osu_id }}" class="player-image" alt="">
<span class="player-name">{{ record.osu_name }}</span> <span class="player-name">{{ record.osu_name }}</span>
</a> </a>
</div> </div>
<div class="game-title standard"> <div class="game-title standard">
<img src="https://osu.ppy.sh/help/wiki/shared/mode/osu.png"> osu! <img src="https://osu.ppy.sh/help/wiki/shared/mode/osu.png" alt=""> osu!
</div> </div>
<div class="game-score standard"> <div class="game-score standard">
<span class="number">{{ record.std_pp | int }}</span><span class="pp">pp</span> <span class="number">{{ record.std_pp | int }}</span><span class="pp">pp</span>
</div> </div>
<div class="game-title taiko"> <div class="game-title taiko">
<img src="https://osu.ppy.sh/help/wiki/shared/mode/taiko.png"> taiko <img src="https://osu.ppy.sh/help/wiki/shared/mode/taiko.png" alt=""> taiko
</div> </div>
<div class="game-score taiko"> <div class="game-score taiko">
<span class="number">{{ record.taiko_pp | int }}</span><span class="pp">pp</span> <span class="number">{{ record.taiko_pp | int }}</span><span class="pp">pp</span>
</div> </div>
<div class="game-title catch"> <div class="game-title catch">
<img src="https://osu.ppy.sh/help/wiki/shared/mode/catch.png"> catch <img src="https://osu.ppy.sh/help/wiki/shared/mode/catch.png" alt=""> catch
</div> </div>
<div class="game-score catch"> <div class="game-score catch">
<span class="number">{{ record.catch_pp | int }}</span><span class="pp">pp</span> <span class="number">{{ record.catch_pp | int }}</span><span class="pp">pp</span>
</div> </div>
<div class="game-title mania"> <div class="game-title mania">
<img src="https://osu.ppy.sh/help/wiki/shared/mode/mania.png"> mania <img src="https://osu.ppy.sh/help/wiki/shared/mode/mania.png" alt=""> mania
</div> </div>
<div class="game-score mania"> <div class="game-score mania">
<span class="number">{{ record.mania_pp | int }}</span><span class="pp">pp</span> <span class="number">{{ record.mania_pp | int }}</span><span class="pp">pp</span>

View file

@ -10,7 +10,7 @@
<div class="game-grid ow"> <div class="game-grid ow">
<div class="player"> <div class="player">
<a href="https://playoverwatch.com/en-us/career/pc/eu/{{ record.__str__(separator='-') }}"> <a href="https://playoverwatch.com/en-us/career/pc/eu/{{ record.__str__(separator='-') }}">
<img src="{{ record.icon_url() }}" class="player-image"> <img src="{{ record.icon_url() }}" class="player-image" alt="">
<span class="player-name">{{ record }}</span> <span class="player-name">{{ record }}</span>
</a> </a>
</div> </div>
@ -25,7 +25,7 @@
<div class="icon unranked"></div> <div class="icon unranked"></div>
<span class="text unranked">Non classificato</span> <span class="text unranked">Non classificato</span>
{% else %} {% else %}
<img class="icon ranked" src="{{ record.rank_url() }}"> <img class="icon ranked" src="{{ record.rank_url() }}" title="{{ record.rank_name() }}" alt="{{ record.rank_name() }}">
<span class="text ranked">{{ record.rank }}</span> <span class="text ranked">{{ record.rank }}</span>
{% endif %} {% endif %}
</div> </div>

View file

@ -37,12 +37,12 @@
{% if record.most_played_game_id %} {% if record.most_played_game_id %}
<a href="https://store.steampowered.com/app/{{ record.most_played_game_id }}/"> <a href="https://store.steampowered.com/app/{{ record.most_played_game_id }}/">
<div class="game-banner"> <div class="game-banner">
<img src="https://steamcdn-a.akamaihd.net/steam/apps/{{ record.most_played_game_id }}/header.jpg"> <img class="game-image" src="https://steamcdn-a.akamaihd.net/steam/apps/{{ record.most_played_game_id }}/header.jpg" alt="{{ record.most_played_game_id }}">
</div> </div>
</a> </a>
{% else %} {% else %}
<div class="game-banner"> <div class="game-banner">
<img> <div class="game-image">
</div> </div>
{% endif %} {% endif %}
</div> </div>