planet-wars/backend/templates/state_partial.html.tera
2020-04-01 20:49:50 +02:00

26 lines
1 KiB
Text

{% for state in games %}
<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>
<span style="float: right">{% if state.type == "Finished" %}Done{% else %}{{ state.connected }}/{{state.total}}{% endif %}</span>
</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 %}
</div>
</section>
{% endfor %}