planet-wars/backend/templates/state_partial.html.tera

27 lines
1 KiB
Text
Raw Normal View History

2020-03-28 20:55:39 +01:00
{% for state in games %}
2020-04-01 20:49:50 +02:00
<section class="accordion">
<input type="checkbox" name="collapse" id="handle_{{loop.index}}">
<h2 class="handle">
<label for="handle_{{loop.index}}">
<span>{{state.name}} ({{state.map}})</span>
2020-04-01 23:03:18 +02:00
<span style="float: right">{% if state.type == "Playing" %}{{ state.connected }}/{{state.total}}{% endif %}</span>
2020-04-01 20:49:50 +02:00
</label>
</h2>
<div class="content">
{% if state.type == "Playing" %}
<div class="players">
{% for player in state.players %}
<p class="{% if player.waiting %}waiting {% endif %}{% if player.connected %}connected {% endif %}{% if player.reconnecting %}reconnecting {% endif %}">{{ player.value }}</p>
{% endfor %}
</div>
{% else %}
<div class="players">
{% for player in state.players %}
<p class="{% if player[1] %}winner{% endif %}">{{ player[0] }}</p>
{% endfor %}
</div>
{% endif %}
2020-03-28 20:55:39 +01:00
</div>
2020-04-01 20:49:50 +02:00
</section>
2020-03-28 20:55:39 +01:00
{% endfor %}