1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-30 15:04:18 +00:00

Aggiunta centrale atomica

This commit is contained in:
Steffo 2018-06-01 13:36:30 +02:00
parent bfcf9a566d
commit 803eca5b4e
7 changed files with 22 additions and 538 deletions

View file

@ -1,116 +0,0 @@
body {
background-color: #ff7f00;
color: black;
}
table {
background-color: #fff2cd !important;
border-radius: 5px;
}
.table td, .table th {
border: none !important;
}
table.rl {
background: linear-gradient(to bottom,rgba(35,91,139,.5),rgba(16,54,84,.5)),linear-gradient(to right,rgba(35,91,139,.7),rgba(16,54,84,.7)) !important;
border-radius: 6px !important;
border: none !important;
padding: 12px !important;
color: white !important;
}
table.dota {
background-color: #2e2d45 !important;
border: none !important;
padding: 12px !important;
color: white !important;
}
table.dota th {
border-bottom: 1px solid #666 !important;
}
.dota-rank-medal-stars {
position: relative;
left: -32px;
margin-right: -32px;
}
.rl-rank-hidden {
display: none;
}
.rl-rank-text {
display: inline-block;
vertical-align: middle;
}
.rl-rank-division {
font-size: 9px;
}
.thirtytwo {
width: 32px;
height: 32px;
}
.round {
border-radius: 16px;
}
.slightly-round {
border-radius: 2px;
}
.rl-rank-number {
line-height: 14px;
}
.unranked {
color: grey;
}
th {
cursor: pointer !important;
}
.scatola {
background-color: #fff2cc;
border-radius: 5px;
padding-left: 12px;
padding-right: 12px;
margin-left: 5px;
margin-right: 5px;
font-size: large;
}
.diario-entry {
margin-top: 8px;
margin-bottom: 8px;
}
.diario-data {
font-size: small;
}
.saver-data {
font-size: smaller;
}
.timestamp-data {
text-align: right;
}
.challenge-bar {
height: 100px;
}
.challenge-bar.progress {
background-color: orange;
}
.challenge-bar.progress-bar {
background-color: yellow;
color: black;
}

View file

@ -1,34 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Challenge 1 - RYG</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css"
integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">
<link rel="stylesheet" href="{{ url_for('static', filename='royal.css') }}">
</head>
<body>
<div class="container">
<h1>
Royal Challenge
</h1>
<h2>
La Prima Sfida
</h2>
<p>
L'obiettivo di questa settimana sarà di raggiungere {{ (target) | int }}pp totali su osu! Ovvero, di guadagnare <b>{{ (target-starting) | int }}pp</b> in qualsiasi modalità partendo da adesso.
</p>
<p>
<small>
Più che altro è per provare una roba con il database della Royal Games, però sarebbe bello che tutti provassero a fare qualche pp...
</small>
</p>
<div class="progress challenge-bar">
<div class="progress-bar challenge-bar" role="progressbar" style="width: {{ ((result-starting) / (target-starting) * 100) | int }}%">
{{ (result-starting) | int }}pp
</div>
</div>
</div>
</body>
</html>

View file

@ -1,44 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Diario - RYG</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css"
integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">
<link rel="stylesheet" href="{{ url_for('static', filename='royal.css') }}">
</head>
<body>
<div class="container">
<h1>
Diario Royal Games
</h1>
{% for entry in diario_data %}
<div id="diario-{{ entry.id }}" class="diario-entry">
<div class="row">
<div class="col-6">
{% if entry.saver %}
<div id="saver-{{ entry.id }}" class="saver-data diario-data">
Salvato da {{ entry.saver.royal.username }}
</div>
{% endif %}
{% if entry.author %}
<div id="author-{{ entry.id }}" class="author-data diario-data">
{{ entry.author.royal.username }}
</div>
{% endif %}
</div>
<div class="col-6">
<div id="timestamp-{{ entry.id }}" class="timestamp-data diario-data">
{{ entry.timestamp.ctime() }}
</div>
</div>
</div>
<div id="text-{{ entry.id }}" class="scatola">
{{ entry.text }}
</div>
</div>
{% endfor %}
</div>
</body>
</html>

View file

@ -1,31 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Index - RYG</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css"
integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">
<link rel="stylesheet" href="{{ url_for('static', filename='royal.css') }}">
</head>
<body>
<div class="container">
<h1>
Royal Games
</h1>
<p>
Prima o poi, qui ci sarà un sito bellissimo.
Molto poi che prima, secondo me.
Probabilmente farà prima ad uscire Half-Life 3 che il sito della Royal Games, ma almeno l'intenzione c'è.
</p>
<div>
Queste sono le pagine che sono più o meno finite:
<ul>
<li><a href="/leaderboards">Classifiche di vari giochi</a></li>
<li><a href="/diario">Diario Royal Games</a></li>
<li><a href="/music">Statistiche sulla musica ascoltata</a></li>
</ul>
</div>
</div>
</body>
</html>

View file

@ -1,250 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Leaderboards - RYG</title>
<script src="{{ url_for('static', filename='sorttable.js') }}"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css"
integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">
<link rel="stylesheet" href="{{ url_for('static', filename='royal.css') }}">
</head>
<body>
<div class="container">
<h1>
Royal Games Leaderboards
</h1>
<h6>
Le classifiche si aggiornano ogni ora
</h6>
<div id="dota">
<h2>
Dota 2
</h2>
<table class="table table-hover sortable dota">
<thead>
<tr>
<th>Royal</th>
<th>Steam</th>
<th>Wins</th>
<th>Rank</th>
</tr>
</thead>
<tbody>
{% for record in dota_data %}
<tr>
<td>{{ record.steam.royal.username }}</td>
<td><a href="http://steamcommunity.com/profiles/{{ record.steam.steam_id }}"><img src="{{ record.steam.avatar_url() }}"> {{ record.steam.persona_name }}</a></td>
<td>{{ record.wins }}</td>
<td sorttable_customkey="{{ record.rank_tier }}">
{% if record.rank_tier is none %}
{% elif record.rank_tier < 10 %}
<div class="dota-rank-medal unranked">
<img class="thirtytwo dota-rank-medal-icon" src="https://www.opendota.com/assets/images/dota2/rank_icons/rank_star_0.png">
{{ record.rank_tier }} piazzamenti completati
</div>
{% else %}
<img class="thirtytwo dota-rank-medal-icon" src="{{ record.get_rank_icon_url() }}">{% if record.get_rank_stars_url() %}<img class="thirtytwo dota-rank-medal-stars" src="{{ record.get_rank_stars_url() }}">{% endif %}
{{ record.get_rank_name() }} {{ record.get_rank_number() }}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div id="rl">
<h2>
Rocket League
</h2>
<table class="table table-hover sortable rl">
<thead>
<tr>
<th>Royal</th>
<th>Steam</th>
<th>Singolo <small>1v1</small></th>
<th>Doppio <small>2v2</small></th>
<th>Standard <small>3v3</small></th>
<th>Solo Standard <small>SoloQ</small></th>
</tr>
</thead>
<tbody>
{% for record in rl_data %}
<tr>
<td>{{ record.steam.royal.username }}</td>
<td><a href="http://steamcommunity.com/profiles/{{ record.steam.steam_id }}"><img src="{{ record.steam.avatar_url() }}"> {{ record.steam.persona_name }}</a></td>
<td class="rl-rank" sorttable_customkey="{{ record.single_mmr if record.single_mmr is not none }}">
{% if record.single_rank is not none %}
<img class="thirtytwo" src="https://rocketleaguestats.com/assets/img/rocket_league/ranked/season_four/{{ record.single_rank }}.png">
<div class="rl-rank-text">
<div class="rl-rank-number">{{ record.single_mmr }}</div>
<div class="rl-rank-division">Div {{ record.single_div + 1 }}</div>
</div>
{% elif record.single_mmr is not none %}
<img class="thirtytwo" src="https://rocketleaguestats.com/assets/img/rocket_league/ranked/season_four/0.png">
<div class="rl-rank-text unranked">
<div class="rl-rank-number">{{ record.single_mmr }}</div>
<div class="rl-rank-division">Inattivo</div>
</div>
{% endif %}
</td>
<td class="rl-rank" sorttable_customkey="{{ record.doubles_mmr if record.doubles_mmr is not none }}">
{% if record.doubles_rank is not none %}
<img class="thirtytwo" src="https://rocketleaguestats.com/assets/img/rocket_league/ranked/season_four/{{ record.doubles_rank }}.png">
<div class="rl-rank-text">
<div class="rl-rank-number">{{ record.doubles_mmr }}</div>
<div class="rl-rank-division">Div {{ record.doubles_div + 1 }}</div>
</div>
{% elif record.doubles_mmr is not none %}
<img class="thirtytwo" src="https://rocketleaguestats.com/assets/img/rocket_league/ranked/season_four/0.png">
<div class="rl-rank-text unranked">
<div class="rl-rank-number">{{ record.doubles_mmr }}</div>
<div class="rl-rank-division">Inattivo</div>
</div>
{% endif %}
</td>
<td class="rl-rank" sorttable_customkey="{{ record.standard_mmr if record.standard_mmr is not none }}">
{% if record.standard_rank is not none %}
<img class="thirtytwo" src="https://rocketleaguestats.com/assets/img/rocket_league/ranked/season_four/{{ record.standard_rank }}.png">
<div class="rl-rank-text">
<div class="rl-rank-number">{{ record.standard_mmr }}</div>
<div class="rl-rank-division">Div {{ record.standard_div + 1 }}</div>
</div>
{% elif record.standard_mmr is not none %}
<img class="thirtytwo" src="https://rocketleaguestats.com/assets/img/rocket_league/ranked/season_four/0.png">
<div class="rl-rank-text unranked">
<div class="rl-rank-number">{{ record.standard_mmr }}</div>
<div class="rl-rank-division">Inattivo</div>
</div>
{% endif %}
</td>
<td class="rl-rank" sorttable_customkey="{{ record.solo_std_mmr if record.solo_std_mmr is not none }}">
{% if record.solo_std_rank is not none %}
<img class="thirtytwo" src="https://rocketleaguestats.com/assets/img/rocket_league/ranked/season_four/{{ record.solo_std_rank }}.png">
<div class="rl-rank-text">
<div class="rl-rank-number">{{ record.solo_std_mmr }}</div>
<div class="rl-rank-division">Div {{ record.solo_std_div + 1 }}</div>
</div>
{% elif record.solo_std_mmr is not none %}
<img class="thirtytwo" src="https://rocketleaguestats.com/assets/img/rocket_league/ranked/season_four/0.png">
<div class="rl-rank-text unranked">
<div class="rl-rank-number">{{ record.solo_std_mmr }}</div>
<div class="rl-rank-division">Inattivo</div>
</div>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div id="overwatch">
<h2>
Overwatch
</h2>
<table class="table table-hover sortable">
<thead>
<tr>
<th>Royal</th>
<th>Battletag</th>
<th>Livello</th>
<th>Rank</th>
</tr>
</thead>
<tbody>
{% for record in ow_data %}
<tr>
<td>{{ record.royal.username }}</td>
<td><a href="https://playoverwatch.com/en-us/career/pc/eu/{{ record.__str__(separator='-') }}"><img class="thirtytwo slightly-round" src="{{ record.icon_url() }}"> {{ record }}</a></td>
<td>{{ record.level }}</td>
<td>
{% if record.rank is not none %}
<img class="thirtytwo" src="https://d1u1mce87gyfbn.cloudfront.net/game/rank-icons/season-2/rank-
{% if record.rank < 1500 %}1
{% elif record.rank < 2000 %}2
{% elif record.rank < 2500 %}3
{% elif record.rank < 3000 %}4
{% elif record.rank < 3500 %}5
{% elif record.rank < 4000 %}6
{% endif %}.png">
{{ record.rank }}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div id="osu">
<h2>
Osu!
</h2>
<table class="table table-hover sortable">
<thead>
<tr>
<th>Royal</th>
<th>Username</th>
<th>osu!</th>
<th>osu!taiko</th>
<th>osu!catch</th>
<th>osu!mania</th>
</tr>
</thead>
<tbody>
{% for record in osu_data %}
<tr>
<td>{{ record.royal.username }}</td>
<td><a href="https://osu.ppy.sh/users/{{ record.osu_id }}"><img class="thirtytwo" src="https://a.ppy.sh/{{ record.osu_id }}"> {{ record.osu_name }}</a></td>
<td sorttable_customkey="{{ record.std_pp }}">{{ record.std_pp|round(0, "floor")|int if record.std_pp is not none and record.std_pp >= 1 }}</td>
<td sorttable_customkey="{{ record.taiko_pp }}">{{ record.taiko_pp|round(0, "floor")|int if record.taiko_pp is not none and record.taiko_pp >= 1 }}</td>
<td sorttable_customkey="{{ record.catch_pp }}">{{ record.catch_pp|round(0, "floor")|int if record.catch_pp is not none and record.catch_pp >= 1 }}</td>
<td sorttable_customkey="{{ record.mania_pp }}">{{ record.mania_pp|round(0, "floor")|int if record.mania_pp is not none and record.mania_pp >= 1 }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div id="league">
<h2>
League of Legends
</h2>
<table class="table table-hover sortable">
<thead>
<tr>
<th>Royal</th>
<th>Summoner</th>
<th>Livello</th>
<th>Solo <small>SR</small></th>
<th>Flex <small>SR</small></th>
<th>Flex <small>TT</small></th>
</tr>
</thead>
<tbody>
{% for record in lol_data %}
<tr>
<td>{{ record.royal.username }}</td>
<td><img class="thirtytwo round" src="http://avatar.leagueoflegends.com/EUW1/{{ record.summoner_name }}.png"> {{ record.summoner_name }}</td>
<td>{{ record.level }}</td>
{% if record.solo_division is not none %}
<td sorttable_customkey="{{ (record.solo_division.value + 1) * 6 - record.solo_rank.value }}"><img class="thirtytwo" src="{{ url_for('static', filename='lol-rank-icons/' + record.solo_division.name|lower + "_" + record.solo_rank.name|lower + ".png") }}"> {{ record.solo_division.name|capitalize }} {{ record.solo_rank.name }}</td>
{% else %}
<td></td>
{% endif %}
{% if record.flex_division is not none %}
<td sorttable_customkey="{{ (record.flex_division.value + 1) * 6 - record.flex_rank.value }}"><img class="thirtytwo" src="{{ url_for('static', filename='lol-rank-icons/' + record.flex_division.name|lower + "_" + record.flex_rank.name|lower + ".png") }}"> {{ record.flex_division.name|capitalize }} {{ record.flex_rank.name }}</td>
{% else %}
<td></td>
{% endif %}
{% if record.twtr_division is not none %}
<td sorttable_customkey="{{ (record.twtr_division.value + 1) * 6 - record.twtr_rank.value }}"><img class="thirtytwo" src="{{ url_for('static', filename='lol-rank-icons/' + record.twtr_division.name|lower + "_" + record.twtr_rank.name|lower + ".png") }}"> {{ record.twtr_division.name|capitalize }} {{ record.twtr_rank.name }}</td>
{% else %}
<td></td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</body>
</html>

22
templates/main.html Normal file
View file

@ -0,0 +1,22 @@
{% extends 'base.html' %}
{% block pagetitle %}
Royal Games
{% endblock %}
{% block body %}
<h1>
Login
</h1>
<form class="input-grid" action="{{ url_for('page_loggedin') }}" method="POST">
<label id="label-username" for="input-username">
Username
</label>
<input id="input-username" name="username" type="text">
<label id="label-password" for="input-password">
Password
</label>
<input id="input-password" name="password" type="password">
<input type="submit" value="Login">
</form>
{% endblock %}

View file

@ -1,63 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Music - RYG</title>
<script src="{{ url_for('static', filename='sorttable.js') }}"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css"
integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">
<link rel="stylesheet" href="{{ url_for('static', filename='royal.css') }}">
</head>
<body>
<div class="container">
<h1>
Royal Music
</h1>
<div id="music">
<h2>
File più ascoltati
</h2>
<table class="table table-hover sortable">
<thead>
<tr>
<th>File</th>
<th>Ascoltato</th>
</tr>
</thead>
<tbody>
{% for record in music_counts %}
<tr>
<td><a href="https://royal.steffo.eu/music/{{ record.filename }}.opus">{{ record.filename }}</a></td>
<td sorttable_customkey="{{ record[1] }}">{{ record[1] }} volt{{ 'a' if record[1] == 1 else 'e' }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<h2>
Cronologia
</h2>
<table class="table table-hover">
<thead>
<tr>
<th>File</th>
<th>Aggiunto da</th>
</tr>
</thead>
<tbody>
{% for record in music_last %}
<tr>
<td><a href="https://royal.steffo.eu/music/{{ record.filename }}.opus">{{ record.filename }}</a></td>
{% if record.enqueuer is not none %}
<td><img class="thirtytwo round" src="{{ record.enqueuer.avatar_url(size=32) }}"> {{ record.enqueuer }}</td>
{% else %}
<td></td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</body>
</html>