wip: index & mapnames

This commit is contained in:
2023-06-10 18:21:30 +02:00
parent b90ae05505
commit 34ca33f71a
5 changed files with 99 additions and 41 deletions

View File

@@ -16,7 +16,7 @@
dt = $('#tableMain').DataTable({
serverSide: true,
ajax: {
url: '/data-source',
url: '/data-source/{{ map_uid }}',
type: 'POST'
},
"columnDefs": [

28
templates/head.html Normal file
View File

@@ -0,0 +1,28 @@
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="Image factory providing automatically resized and re-encoded images.">
<meta name="author" content="Yannik Schmidt">
<meta name="title" content="TM Replays">
<meta property="og:type" content="website" />
<meta property="og:title" content="Trackmania Replay Server" />
<meta property="og:description" content="TM Replay Server developed by Yannik Schmidt" />
<meta property="og:url" content="/" />
<link rel="shortcut icon" href="/defaultFavicon.ico">
<!-- Bootstrap core JS -->
<script src="https://cdn.atlantishq.de/js/jquery.min.js"></script>
<!-- Bootstrap core CSS -->
<link href="https://cdn.atlantishq.de/fontawesome/css/all.css" rel="stylesheet">
<link href="https://cdn.atlantishq.de/css/bootstrap.min.css" rel="stylesheet">
<script defer src="https://cdn.atlantishq.de/js/bootstrap.min.js"></script>
<script defer src="https://cdn.atlantishq.de/js/addons/datatables.min.js"></script>
<!-- mdb -->
<link href="https://cdn.atlantishq.de/css/mdb.min.css" rel="stylesheet">
<script defer src="https://cdn.atlantishq.de/js/mdb.min.js"></script>
</head>

31
templates/index.html Normal file
View File

@@ -0,0 +1,31 @@
<head>
{% include "head.html" %}
</head>
<body>
<table>
<thead>
<tr>
<th class="px-2">Map</th>
{% if player %}
<th class="px-2">Personal Best</th>
{% endif %}
<th class="px-2">Record</th>
<th class="px-2">Record Age</th>
</tr>
</thead>
<tbody>
{% for map in maps %}
<tr>
<td class="px-2">
<a href="/map-info?map_uid={{ map.map_uid }}">{{ map.mapname }}</a>
</td>
{% if player %}
<td class="px-2">{{ map.get_best_for_player(player) }}</td>
{% endif %}
<td class="px-2">{{ map.get_best_replay_repr() }}</td>
<td class="px-2">{{ map.get_best_replay_age() }} days</td>
</tr>
{% endfor %}
</tbody>
</table>
</body>

View File

@@ -1,30 +1,5 @@
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="Image factory providing automatically resized and re-encoded images.">
<meta name="author" content="Yannik Schmidt">
<meta name="title" content="TM Replays">
<meta property="og:type" content="website" />
<meta property="og:title" content="Trackmania Replay Server" />
<meta property="og:description" content="TM Replay Server developed by Yannik Schmidt" />
<meta property="og:url" content="/" />
<link rel="shortcut icon" href="/defaultFavicon.ico">
<!-- Bootstrap core JS -->
<script src="https://cdn.atlantishq.de/js/jquery.min.js"></script>
<!-- Bootstrap core CSS -->
<link href="https://cdn.atlantishq.de/fontawesome/css/all.css" rel="stylesheet">
<link href="https://cdn.atlantishq.de/css/bootstrap.min.css" rel="stylesheet">
<script defer src="https://cdn.atlantishq.de/js/bootstrap.min.js"></script>
<script defer src="https://cdn.atlantishq.de/js/addons/datatables.min.js"></script>
<!-- mdb -->
<link href="https://cdn.atlantishq.de/css/mdb.min.css" rel="stylesheet">
<script defer src="https://cdn.atlantishq.de/js/mdb.min.js"></script>
{% include "head.html" %}
</head>
<body>
{% include "datatable.html" %}