visual improvements, migrate main view to dataTable

This commit is contained in:
2020-12-18 11:57:04 +01:00
parent c9ea8913ec
commit 6a2a4b6fa0
10 changed files with 96 additions and 59 deletions

View File

@@ -6,27 +6,35 @@
<script src="static/buttons.js" defer></script>
{% include "default_head_content.html" %}
</head>
<body>
<body class="bg-special">
{% include 'navbar_leaderboard.html' %}
<div class="container mt-3 mb-3" role="main">
<div class=colum-names>{{ columNames }}</div>
{% for player in playerList %}
{% set count = loop.index + start %}
{% if count % 2 == 0 %}
<div class="line-even {% if searchName == player.name %}targetPlayer{% endif %}">
<a href="/player?id={{ player.playerId }}">
{{ player.getLineHTML(count) }}
</a>
</div>
{% else %}
<div class="line-odd {% if searchName == player.name %}targetPlayer{% endif %}">
<a href="/player?id={{ player.playerId }}">
{{ player.getLineHTML(count) }}
</a>
</div>
{% endif %}
{% endfor %}
{{ endOfBoardIndicator }}
<div class="container mt-3 mb-3" role="main">
<table id="tableMain" class="table table-striped table-bordered table-sm"
cellspacing="0" width="100%">
<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>{{ count }}</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>
{% include 'footer.html' %}
</body>

View File

@@ -2,8 +2,8 @@
<a style="color: rgba(255,255,255,.5);"
class="footerLink" href="https://blog.atlantishq.de/about">Impressum/Legal</a>
<a style="color: rgba(255,255,255,.5);"
class="footerLink mid" href="https://blog.atlantishq.de/post/insurgency-rating-1/">
How does it work?</a>
class="footerLink mid" href="steam://connect/athq.de/:27026">
Join the Server!</a>
<a style="color: rgba(255,255,255,.5);"
class="footerLink" href="https://github.com/FAUSheppy/skillbird">Star on GitHub</a>
</div>

View File

@@ -3,24 +3,7 @@
<head>
<title>Maps</title>
<meta name="Description" content="Insurgency Map Overview">
<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>
{% include "default_head_content.html" %}
</head>
<body class="bg-special">
{% include 'navbar.html' %}
@@ -34,34 +17,50 @@
<th class="th-sm font-weight-bold">Insurgent Win</th>
<th class="th-sm font-weight-bold">Security Win</th>
<th class="th-sm font-weight-bold">Average Time</th>
<th class="th-sm font-weight-bold">Rating System Deviation*</th>
<th class="th-sm font-weight-bold">Rating System Performance</th>
</tr>
</thead>
<tbody>
{% for m in maps %}
<tr {% if m.totalGames < 20 %} style="opacity: 0.4;" {% endif %}>
<tr>
<td>{{ m.mapName }}</td>
<td>{{ m.totalGames }}</td>
<td>{{ '%0.2f' | format(m.insurgentWinPercent) }}%</td>
<td>{{ '%0.2f' | format(m.securityWinPercent) }}%</td>
<td>{{ m.averageTime }}</td>
{% if m.ratingSystemDeviation >= 0 %}
<td style="color: green;">+{{ '%0.2f' | format(m.ratingSystemDeviation) }}%
{% if m.ratingSystemDeviation == 0 or m.predictionCorrectPercentage == 0%}
<td style="color: grey;">N/A</td>
{% elif m.ratingSystemDeviation >= 0 %}
<td style="color: green;">
+{{ '%0.2f' | format(m.ratingSystemDeviation) }}%
({{ m.predictionCorrectPercentage }}% Correct)
</td>
{% else %}
<td style="color: red;">{{ '%0.2f' | format(m.ratingSystemDeviation) }}%
<td style="color: red;">
{{ '%0.2f' | format(m.ratingSystemDeviation) }}%
({{ m.predictionCorrectPercentage }}% Correct)
</td>
{% endif %}
</tr>
{# <!--
{{ m.confidence }}
{{ m.predictions }}
--> #}
{% endfor %}
</tbody>
</table>
<div class="mt-2 mb-2">
<p>
<i>*Rating System Deviation:</i> Percentage difference between the ratio of correctly predicted games by the rating system, to the average confidence of those predictions. For example: 10 games played, 6 games correctly predicted based on ratings with an average confidence of 50% is +20% deviation.
</p>
<div class="mt-2 pt-3 mb-2">
<small>
*Map Tracking was only implemented recently, that is why there are many rounds without a recorded mapname.
</small>
</div>
</div>
{% include 'footer.html' %}
<script defer>
$(document).ready(function () {
$('#tableMain').DataTable();
$('.dataTables_length').addClass('bs-select');
});
</script>
</body>
</html>

View File

@@ -27,8 +27,8 @@
<a class="nav-link" href="steam://connect/athq.de/:27015">Server 2</a>
</li>
<li class="nav-item">
<a class="navbar-brand hover-to-75" style="position: unset !important;" href="https://www.buymeacoffee.com/sheppy">
<img style="max-height: 1.5rem;" src='/static/buymeacoffee.png'></img>
<a class="navbar-brand hover-to-75 patreon" style="position: unset !important;" href="https://www.patreon.com/erlangen_sheppy">Support me
<!--<img style="max-height: 1.5rem;" src='/static/patreon.jpg'></img>-->
</a>
</li>
<ul>

View File

@@ -21,8 +21,8 @@
</ul>
<ul class="navbar-nav">
<li class="nav-item">
<a class="navbar-brand hover-to-75" style="position: unset !important;" href="https://www.buymeacoffee.com/sheppy">
<img style="max-height: 2rem;" src='/static/buymeacoffee.png'></img>
<a class="navbar-brand hover-to-75 patreon" style="position: unset !important;" href="https://www.patreon.com/erlangen_sheppy">Support me
<!--<img style="max-height: 2rem;" src='/static/patreon.png'></img>-->
</a>
</li>
<li class="nav-item right mr-2">