Files
open-web-leaderboard/templates/player.html
2020-09-28 06:12:36 +02:00

82 lines
3.1 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<title>Leaderboard</title>
<meta name="Description" content="Player: {{ player.name }}">
<link rel="stylesheet" type="text/css" href="/static/site.css">
<link rel="shortcut icon" href="/static/defaultFavicon.ico">
<!-- needed for @media-css mofiers -->
<meta content="width=device-width, initial-scale=1" name="viewport" />
<!-- Font Awesome -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css">
<!-- Bootstrap core CSS -->
<link href="static/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Material Design Bootstrap -->
<link href="static/bootstrap/css/mdb.min.css" rel="stylesheet">
<script src="static/bootstrap/js/jquery.js"></script>
<script src="static/bootstrap/js/popper.js"></script>
<script src="static/bootstrap/js/bootstrap.js"></script>
<script src="static/bootstrap/js/mdb.min.js"></script>
</head>
<body class="bg-special">
{% include 'navbar.html' %}
<div class="container mt-3 mb-3" role="main">
<div class="player-headline">
<h1>
{{ player.name }}
</h1>
<h3>
Rating: <i>{{ player.rating }}</i> <br>
{% if player.rank == 0 %}
<i><small>missing {{ 10 - player.games }} placement games</small></i>
{% elif not player.lastGame %}
<i><small>Hasn't played enought games recently</small></i>
{% else %}
Rank: {{ player.rank }}
{%endif%}
</h3>
</div>
<div class="plot-container">
<canvas id="lineChart">
</canvas>
</div>
<p class="mt-5 mb-3">
</p>
</div>
{% include 'footer.html' %}
<script defer>
var canvas = document.getElementById("lineChart").getContext('2d');
var historicalRank = new Chart(canvas, {
type: 'line',
data: {
labels: [ {{ CSV_MONTH_YEAR_OF_RATINGS | safe }} ],
datasets: [{
label: "Rating",
data: [ {{ CSV_RATINGS | safe }} ],
backgroundColor: [ 'rgba(105, 0, 132, .2)' ],
borderColor: [ 'rgba(200, 99, 132, .7)' ],
borderWidth: 2
}],
options: {
scales: {
yAxes: [{
ticks : {
suggestedMin : {{ Y_MIN }},
suggestedMax : {{ Y_MAX }},
min : {{ Y_MIN }},
max : {{ Y_MAX }}
}
}]
},
responsive: true
}
}
});
</script>
</body>
</html>