mirror of
https://github.com/FAUSheppy/open-web-leaderboard.git
synced 2025-12-06 07:01:36 +01:00
71 lines
2.9 KiB
HTML
71 lines
2.9 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<title>Leaderboard</title>
|
|
<meta name="Description" content="Insurgency Leaderboard">
|
|
<script src="static/buttons.js" defer></script>
|
|
{% include "default_head_content.html" %}
|
|
</head>
|
|
<body class="bg-special">
|
|
{% include 'navbar_leaderboard.html' %}
|
|
|
|
<div class="container mt-3 mb-3" role="main">
|
|
<div id="playerDisplay" class="playerDisplay mb-3 mt-2">
|
|
<script>
|
|
function players(){
|
|
fetch("/players-online").then(
|
|
response => response.json()
|
|
).then(
|
|
data => {
|
|
if(data["error"] == ""){
|
|
document.getElementById("playerDisplay").innerHTML = "Players Online: " + data["player_total"]
|
|
}else{
|
|
document.getElementById("playerDisplay").innerHTML = "Players Online: (error)" + data["error"]
|
|
}
|
|
}
|
|
)
|
|
}
|
|
players()
|
|
setInterval(players, 2000)
|
|
</script>
|
|
</div>
|
|
<table id="tableMain" class="table table-striped table-bordered table-sm"
|
|
cellspacing="0">
|
|
<thead>
|
|
<tr>
|
|
<th class="th-sm font-weight-bold">Rank</th>
|
|
<th class="th-sm font-weight-bold">Player</th>
|
|
<th class="th-sm font-weight-bold">Games</th>
|
|
<th class="th-sm font-weight-bold">Rating</th>
|
|
<th class="th-sm font-weight-bold">Winratio %</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for p in playerList %}
|
|
{% set count = loop.index + start %}
|
|
<tr {% if searchName and searchName == p.name %} id="targetPlayer" {% endif %}>
|
|
<td>{% if doNotComputeRank %} {{ count }} {% else %} {{ p.rankStr }} {% endif %}</td>
|
|
<td><a href="/player?id={{ p.playerId }}">{{ p.name }}</a></td>
|
|
<td>{{ p.games }}</td>
|
|
<td>{{ p.rating }}</td>
|
|
<td>{{ p.winratio }}%</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{{ endOfBoardIndicator }}
|
|
</div>
|
|
|
|
{% if not doNotComputeRank %}
|
|
<script defer>
|
|
$(document).ready(function () {
|
|
$('#tableMain').DataTable();
|
|
$('.dataTables_length').addClass('bs-select');
|
|
});
|
|
</script>
|
|
{% endif %}
|
|
|
|
</body>
|
|
{% include 'footer.html' %}
|
|
</html>
|