deduplicate website templates
This commit is contained in:
parent
80964bbe21
commit
befb81caa8
4 changed files with 50 additions and 95 deletions
|
@ -386,6 +386,4 @@ def render_leaderboard():
|
|||
# Copy CSS to output directory
|
||||
shutil.copytree('css', 'build/css', dirs_exist_ok=True)
|
||||
|
||||
for x in get_games():
|
||||
print(x)
|
||||
render_leaderboard()
|
||||
|
|
|
@ -1,4 +1,35 @@
|
|||
{% extends "layout.html" %}
|
||||
|
||||
{% block navbar %}
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="#">The Hanabi Pro Hunting League<small class="text-muted"> - Season One</small></a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav ml-auto">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" id="summary-tab" data-toggle="tab" href="#summary">Summary</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="leaderboards-0-tab" data-toggle="tab" href="#leaderboards-0">No Variant</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="leaderboards-1-tab" data-toggle="tab" href="#leaderboards-1">Clue Starved</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="variant-tab" data-toggle="tab" href="#variants">Variants</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="info-tab" data-toggle="tab" href="#info">Info</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="tab-content" id="myTabContent">
|
||||
<div class="tab-pane fade active show" id="summary">
|
||||
|
|
|
@ -5,37 +5,20 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Hanabi Pro Hunting League</title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="css/leaderboards.css">
|
||||
<link rel="stylesheet" href="/css/leaderboards.css">
|
||||
<!-- Tabulator CSS dependency -->
|
||||
<link rel="stylesheet" href="/css/tabulator.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="#">The Hanabi Pro Hunting League<small class="text-muted"> - Season One</small></a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav ml-auto">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" id="summary-tab" data-toggle="tab" href="#summary">Summary</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="leaderboards-0-tab" data-toggle="tab" href="#leaderboards-0">No Variant</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="leaderboards-1-tab" data-toggle="tab" href="#leaderboards-1">Clue Starved</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="variant-tab" data-toggle="tab" href="#variants">Variants</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="info-tab" data-toggle="tab" href="#info">Info</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<!-- Bootstrap JavaScript dependencies -->
|
||||
<script src="https://code.jquery.com/jquery-3.7.0.slim.min.js" integrity="sha256-tG5mcZUtJsZvyKAxYLVXrmjKBVLd6VpVccqz/r4ypFE=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Tabulator JS dependency -->
|
||||
<script type="text/javascript" src="/js/tabulator.min.js"></script>
|
||||
|
||||
{% block navbar %}{% endblock %}
|
||||
{% block content %}{% endblock %}
|
||||
|
||||
<footer class="footer mt-auto py-3 bg-light">
|
||||
|
@ -45,12 +28,7 @@
|
|||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- Bootstrap JavaScript dependencies -->
|
||||
<script src="https://code.jquery.com/jquery-3.7.0.slim.min.js" integrity="sha256-tG5mcZUtJsZvyKAxYLVXrmjKBVLd6VpVccqz/r4ypFE=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct" crossorigin="anonymous"></script>
|
||||
|
||||
|
||||
<!-- Handle navbar selections -->
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.nav-link').on('shown.bs.tab', function(e) {
|
||||
|
@ -63,7 +41,7 @@
|
|||
});
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Show latest run in local time zone format -->
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
// Get the latest run date in UTC
|
||||
|
|
|
@ -1,18 +1,6 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Hanabi Pro Hunting League</title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="/css/leaderboards.css">
|
||||
<link href="/css/tabulator.min.css" rel="stylesheet">
|
||||
|
||||
<!-- Tabulator JS dependency -->
|
||||
<script type="text/javascript" src="/js/tabulator.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
{% extends "layout.html" %}
|
||||
|
||||
{% block navbar %}
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="/">The Hanabi Pro Hunting League</a><a class="navbar-brand" href="#"><small class="text-muted">- Variant Statistics for {{variant_name}}</small></a>
|
||||
|
@ -33,9 +21,10 @@
|
|||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="tab-content" id="myTabContent">
|
||||
|
||||
{% for num_players, stats in variant_stats.items() %}
|
||||
<div class="tab-pane fade" id="stats-{{num_players}}p">
|
||||
<div class="container my-5">
|
||||
|
@ -90,45 +79,4 @@
|
|||
});
|
||||
{% endfor %}
|
||||
</script>
|
||||
|
||||
<footer class="footer mt-auto py-3 bg-light">
|
||||
<div class="container text-center">
|
||||
<span class="text-muted">{{ total_games_played }} games | {{ total_players }} players | Thanks for playing <3</span><br>
|
||||
<span class="text-muted">Last updated: <span id="latestRun">{{ latest_run }}</span></span>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- Bootstrap JavaScript dependencies -->
|
||||
<script src="https://code.jquery.com/jquery-3.7.0.slim.min.js" integrity="sha256-tG5mcZUtJsZvyKAxYLVXrmjKBVLd6VpVccqz/r4ypFE=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct" crossorigin="anonymous"></script>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.nav-link').on('shown.bs.tab', function(e) {
|
||||
// Remove 'active' class from all nav-items
|
||||
$('.nav-link').removeClass('active');
|
||||
|
||||
// Add 'active' class to the current nav-item
|
||||
$(this).addClass('active');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- Display time of latest run in local time format -->
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
// Get the latest run date in UTC
|
||||
var latestRunUtc = new Date(document.getElementById("latestRun").textContent);
|
||||
|
||||
// Convert it to the local timezone and format it
|
||||
var latestRunLocal = latestRunUtc.toLocaleString("en-US", { month: "short", day: "numeric", year: "numeric", hour: "2-digit", minute: "2-digit" });
|
||||
|
||||
// Set the text content of the latestRun span to the local date
|
||||
document.getElementById("latestRun").textContent = latestRunLocal;
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in a new issue