This commit is contained in:
John Gatward
2026-03-19 21:07:16 +00:00
commit a69ef51825
18 changed files with 1000 additions and 0 deletions

80
src/templates/index.html Normal file
View File

@@ -0,0 +1,80 @@
<!DOCTYPE html>
<html>
<head>
<title>Pub Quiz Dashboard</title>
<script src="https://cdn.plot.ly/plotly-3.0.1.min.js" charset="utf-8"></script>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="flex flex-col items-center">
<h1 class="text-center font-sans text-4xl p-10">📊 Pub Quiz Dashboard</h1>
<div class="w-3/4">
<h2 class="text-2xl mb-4">Stats</h2>
<div class="flex flex-col items-center">
<div class="rounded-md border border-black w-2/5 p-4 m-8">
<ul class="space-y-2">
{% for key, data in stats.items() %}
<li id="{{ key }}" class="flex justify-between">
<span>{{ key }}:</span>
<span class="flex-grow border-b border-dotted mx-2"></span>
<span>{{ data }}</span>
</li>
{% endfor %}
</ul>
</div>
</div>
</div>
<div class="w-3/4 flex flex-col items-center overflow-x-auto">
<table class="w-1/2 text-sm text-gray-700 border-separate border-spacing-0 rounded-xl bg-clip-border shadow-md">
<thead
class="bg-gray-100 text-xs font-semibold uppercase tracking-wider text-gray-700 border-b border-gray-300">
<tr>
{% for heading in player_table[0] %}
<th scope="col" class="px-6 py-4 w-1/3 border-b border-blue-grey-100 bg-blue-grey-50
{% if loop.index == 1 %} text-left
{% elif loop.index == 2 %} text-center
{% else %} text-right
{% endif %}
">
{{ heading }}
</th>
{% endfor %}
</tr>
</thead>
<tbody class="divide-y divide-gray-200">
{% for row in player_table[1:] %}
<tr class="bg-white">
{% for data in row %}
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900 antialiased leading-normal border-b border-blue-grey-50
{% if loop.index == 1 %} text-left
{% elif loop.index == 2 %} text-center
{% else %} text-right
{% endif %}">
{{ data }}
</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="w-3/4">
<h2 class="text-2xl">Plots</h2>
{% for key, plot in plots.items() %}
<div class="m-8 bg-white p-8 rounded-md shadow-md">
<div id="{{ key }}"></div>
<script>
var figure = {{plot | safe }};
Plotly.newPlot("{{ key }}", figure.data, figure.layout);
</script>
</div>
{% endfor %}
</div>
</body>
</html>