hanabi-league/templates/game.html

74 lines
3.1 KiB
HTML
Raw Permalink Normal View History

2024-01-14 00:52:27 +01:00
{% 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">- Endgame Statistics for {{game_id}}</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" id="Back" href="/">Back</a>
</li>
</ul>
</div>
</div>
</nav>
{% endblock %}
{% block content %}
<div class="tab-content" id="myTabContent">
<div class="tab-pane fade show active" id="overview">
<div class="container my-5">
<h3>
2024-01-14 13:11:02 +01:00
Statistics for game {{game_id}}
2024-01-14 00:52:27 +01:00
</h3>
2024-01-14 13:11:02 +01:00
<ul>
<li>
Replay: <a href="https://hanab.live/replay/{{game_id}}">https://hanab.live/replay/{{game_id}}</a>
</li>
<li>
Shared Replay: <a href="https://hanab.live/shared-replay/{{game_id}}">https://hanab.live/shared-replay/{{game_id}}</a>
</li>
</ul>
<h4>
Endgame Analysis table
</h4>
{% if data %}
2024-01-14 12:57:59 +01:00
<table class="endgame-table">
2024-01-14 00:52:27 +01:00
<tr>
<th>Turn</th>
<th>Action</th>
<th>Fractional Probability</th>
<th>Probability</th>
</tr>
{% for (turn, best_action, other_actions) in data %}
<tr>
2024-01-14 13:38:18 +01:00
<td rowspan="{{ other_actions|length + 1 }}"><a href="https://hanab.live/replay/{{game_id}}#{{turn}}">{{ turn }}</a></td>
<td>{% if best_action.marked %}<b>{% endif %}{{ best_action.description }}{% if best_action.marked %}</b>{% endif %}</td>
2024-01-14 00:52:27 +01:00
<td>{{ best_action.enumerator }}/{{ best_action.denominator }}</td>
<td>{{ best_action.win_rate }}%</td>
</tr>
{% for action in other_actions %}
<tr>
2024-01-14 13:38:18 +01:00
<td>{% if action.marked %}<b>{% endif %}{{ action.description }}{% if action.marked %}</b>{% endif %}</td>
2024-01-14 00:52:27 +01:00
<td>{{ action.enumerator }}/{{ action.denominator }}</td>
<td>{{ action.win_rate }}%</td>
</tr>
{% endfor %}
{% endfor %}
</table>
{% else %}
Currently, there is no endgame analysis available for this game. Since the computation is resource extensive,
this might take a while, also depending on how many other games have been played recently.
<br>
Come back later to check again.
{% endif %}
2024-01-14 00:52:27 +01:00
</div>
</div>
</div>
{% endblock %}