Files
bridzik/api/templates/status.html
T
2021-04-18 17:40:38 +02:00

157 lines
6.9 KiB
HTML

<html>
<head>
<title>Bridžik</title>
<link href="/static/style.css" rel="stylesheet">
{% if not action%}
<meta http-equiv="refresh" content="2">
{% endif %}
</head>
<body>
{% with messages = get_flashed_messages() %}
{% if messages %}
<ul>
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
</ul>
<hr>
{% endif %}
{% endwith %}
{% if 'active_player' not in status %}
<h1>Hra sa skončila.</h1>
{% else %}
<div id="header">
<div>
<p id="active_player">Na ťahu je: {{ players[status['active_player']] }}</p>
</div>
<div id="active_round_guesses">
<p></p>
<table style="width: auto;">
<thead>
<th></th>
<th class="state_column_header">{{ players[0] }}</th>
<th class="state_column_header">{{ players[1] }}</th>
<th class="state_column_header">{{ players[2] }}</th>
<th class="state_column_header">{{ players[3] }}</th>
</thead>
<tbody>
<tr>
<th class="state_row_header">Tipy v tomto kole:</th>
{% for player in range(4) %}
<td class="points">{{ status['active_round_guesses'][player] }}</td>
{% endfor %}
</tr>
{% if status['active_round_stashes'] %}
<tr>
<th class="state_row_header">Kôpky v tomto kole:</th>
{% for player in status['active_round_stashes'] %}
<td class="points">{{ player }}</td>
{% endfor %}
</tr>
{% endif %}
</tbody>
</table>
</div>
</div>
<hr>
<div id="wrapper">
<div id="table">
{% if action == 'guess' %}
<h1>Zadaj tip:</h1>
{% include "_guess_form.html" %}
{% endif %}
{% if status['active_stash'] %}
<h1>Aktuálna kôpka:</h1>
<table style="width: auto;">
{% for player in range(status['active_stash']['first_player'], status['active_stash']['first_player'] + 4) %}
<th>{{ players[player % 4] }}</th>
{% endfor %}
<tr>
{% for player in range(status['active_stash']['first_player'], status['active_stash']['first_player'] + 4) %}
<td class="card_display">
{% if status['active_stash']['cards'][player % 4] %}
<img src="/static/cards/{{ status['active_stash']['cards'][player % 4] }}.png" width="80" height="auto">
{% endif %}
</td>
{% endfor %}
</tr>
</table>
{% endif %}
<hr>
{% if action != 'play' %}
<h1>Moje karty:</h1>
<table id="player_hand">
{% for card in status['player_cards'] %}
<td>
<img src="/static/cards/{{ card }}.png" width="80" height="auto">
</td>
{% endfor %}
</table>
{% else %}
<h1>{{ form.card.label }}:</h1>
<form action="{{ url_for('play_card', player=player) }}" method="post">
{{ form.hidden_tag() }}
<p>
<table style="width: auto">
{% for card in status['player_cards'] %}
<td>
<img src="/static/cards/{{ card }}.png" width="80" height="auto">
</td>
{% endfor %}
<tr>
{% for card in status['player_cards'] %}
<td>
<input id="card-{{ loop.index }}" name="card" type="radio" value="{{ card }}">
</td>
{% endfor %}
</tr>
</table>
{% for error in form.card.errors %}
<span style="color: red;">[{{ error }}]</span>
{% endfor %}
{{ form.submit() }}
</p>
</form>
{% endif %}
{% endif %}
</div>
<div id="standings">
<h1>Výsledky</h1>
<table style="width: auto;">
<tr>
<th>{{ players[0] }}</th>
<th>{{ players[1] }}</th>
<th>{{ players[2] }}</th>
<th>{{ players[3] }}</th>
</tr>
{% for series in status['standings'] %}
{% if series %}
{% for round in series %}
{% if round %}
<tr>
{% for player in round %}
<td class="points">{{ player }}</td>
{% endfor %}
</tr>
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
<tr id="points_summary_row">
{% for player in points_sums %}
<td class="points">{{ player }}</td>
{% endfor %}
</tr>
</table>
</div>
</div>
</body>
</html>