mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
Add dota mini
This commit is contained in:
parent
0dadd714e6
commit
59b19c2e15
5 changed files with 101 additions and 4 deletions
|
@ -196,4 +196,72 @@ input[type="text"], input[type="password"] {
|
|||
grid-column: 4;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.dota {
|
||||
padding: 18px;
|
||||
grid-row-gap: 5px;
|
||||
grid-template-columns: 20% 80%;
|
||||
background-image: linear-gradient(to bottom, #801717, #a11d21);
|
||||
color: #ffffff;
|
||||
|
||||
.player {
|
||||
grid-row: 1;
|
||||
grid-column-start: 1;
|
||||
grid-column-end: 3;
|
||||
font-size: large;
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.player-image {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.player-name {
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
grid-row: 2;
|
||||
font-size: x-small;
|
||||
}
|
||||
|
||||
.number {
|
||||
grid-row: 3;
|
||||
font-size: x-large;
|
||||
}
|
||||
|
||||
.wins {
|
||||
grid-column: 1;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.rank {
|
||||
grid-column: 2;
|
||||
grid-row-start: 2;
|
||||
grid-row-end: 4;
|
||||
margin-top: auto;
|
||||
margin-bottom: auto;
|
||||
|
||||
img {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
img.stars {
|
||||
position: relative;
|
||||
height: 44px;
|
||||
left: -44px;
|
||||
margin-right: -44px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
img.medal {
|
||||
height: 44px;
|
||||
}
|
||||
}
|
||||
}
|
28
templates/minis/dota.html
Normal file
28
templates/minis/dota.html
Normal file
|
@ -0,0 +1,28 @@
|
|||
<div class="game-panel">
|
||||
<div class="game-grid dota">
|
||||
<div class="player">
|
||||
<a href="http://steamcommunity.com/profiles/{{ dota.steam.steam_id }}">
|
||||
<img src="{{ dota.steam.avatar_url() }}" class="player-image">
|
||||
<span class="player-name">{{ dota.steam.persona_name }}</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="title wins">
|
||||
Vittorie
|
||||
</div>
|
||||
<div class="number wins">
|
||||
{{ dota.wins }}
|
||||
</div>
|
||||
<div class="rank">
|
||||
{% if dota.rank_tier is none %}
|
||||
<img class="medal" src="https://www.opendota.com/assets/images/dota2/rank_icons/rank_icon_0.png">
|
||||
Non classificato
|
||||
{% elif dota.rank_tier < 10 %}
|
||||
<img class="medal" src="https://www.opendota.com/assets/images/dota2/rank_icons/rank_icon_0.png">
|
||||
{{ dota.rank_tier }} piazzamenti completati
|
||||
{% else %}
|
||||
<img class="medal" src="{{ dota.get_rank_icon_url() }}">{% if dota.get_rank_stars_url() %}<img class="stars" src="{{ dota.get_rank_stars_url() }}">{% endif %}
|
||||
{{ dota.get_rank_name() }}[{{ dota.get_rank_number() }}]
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,6 +1,3 @@
|
|||
<style>
|
||||
@import url('https://fonts.googleapis.com/css?family=Exo+2');
|
||||
</style>
|
||||
<div class="game-panel">
|
||||
<div class="game-grid osu">
|
||||
<div class="background-image"></div>
|
||||
|
|
|
@ -14,4 +14,7 @@
|
|||
{% if rl %}
|
||||
{% include "minis/rl.html" %}
|
||||
{% endif %}
|
||||
{% if dota %}
|
||||
{% include "minis/dota.html" %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
|
@ -34,7 +34,8 @@ def page_profile(name: str):
|
|||
return
|
||||
osu = db_session.query(db.Osu).filter_by(royal=user).one_or_none()
|
||||
rl = db_session.query(db.RocketLeague).join(db.Steam).filter_by(royal=user).one_or_none()
|
||||
return render_template("profile.html", royal=user, osu=osu, rl=rl)
|
||||
dota = db_session.query(db.Dota).join(db.Steam).filter_by(royal=user).one_or_none()
|
||||
return render_template("profile.html", royal=user, osu=osu, rl=rl, dota=dota)
|
||||
|
||||
|
||||
@app.route("/login")
|
||||
|
|
Loading…
Reference in a new issue