pytron-web/templates/index.html.tera

57 lines
2.6 KiB
Plaintext
Raw Normal View History

2019-03-16 11:04:06 +01:00
{% extends "base" %}
{% block content %}
<section class="section">
<div class="container">
2019-03-16 18:45:59 +01:00
<div class="columns is-centered">
<div class="column is-narrow is-desktop">
<table class="table is-bordered is-striped is-narrow is-hoverable">
<tr>
<th></th>
2019-03-19 17:00:43 +01:00
{% for ai in ais %}
<th class="has-text-centered">{{ ai.name }}</th>
2019-03-16 18:45:59 +01:00
{% endfor %}
<th class="has-text-success has-text-centered">✓</th>
<th class="has-text-danger has-text-centered">✗</th>
</tr>
2019-03-19 17:00:43 +01:00
{% for ai1 in ais %}
2019-03-16 18:45:59 +01:00
<tr>
2019-03-19 17:00:43 +01:00
<th class="has-text-centered">{{ ai1.name }}</th>
{% for ai2 in ais %}
{% if ai1.name == ai2.name %}
2019-03-16 18:45:59 +01:00
<td></td>
{% else %}
2019-03-19 17:00:43 +01:00
{% set key = ai1.name ~ "/" ~ ai2.name %}
2019-03-16 18:45:59 +01:00
{% set value = battles | get(key=key) %}
{% if value > 0.5 %}
<td class="has-text-success">{{ value }}</td>
{% elif value < 0.5 %}
<td class="has-text-danger">{{ value }}</td>
{% else %}
<td>{{ value }}</td>
{% endif %}
{% endif %}
{% endfor %}
2019-03-19 17:00:43 +01:00
<td class="has-text-centered"><strong>{{ ai1.victory_count }}</strong></td>
<td class="has-text-centered"><strong>{{ ai1.defeat_count }}</strong></td>
2019-03-16 18:45:59 +01:00
</tr>
{% endfor %}
</table>
</div>
<div class="column is-narrow">
<table class="table is-bordered is-striped is-narrow is-hoverable">
<tr><th class="has-text-centered">AI</th><th>Score</th></tr>
2019-03-19 17:00:43 +01:00
{% for ai in sorted_ais %}
2019-03-16 18:45:59 +01:00
<tr>
2019-03-19 17:00:43 +01:00
<td class="has-text-centered"><strong>{{ ai.name }}</strong></td>
<td class="has-text-centered">{{ ai.victory_count - ai.defeat_count }}</td>
2019-03-16 18:45:59 +01:00
</tr>
{% endfor %}
</table>
</div>
</div>
2019-03-16 11:04:06 +01:00
</div>
</section>
{% endblock %}
2019-03-16 18:45:59 +01:00