1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-07-03 16:42:52 +02:00
Files
plateforme-tfjm2/draw/templates/draw/tournament_content.html
Emmy D'Anello a8419a6192 Add Abort button
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
2023-03-31 18:28:42 +02:00

272 lines
19 KiB
HTML

{% load i18n %}
<div id="banner-not-started-{{ tournament.id }}" class="alert alert-warning{% if tournament.draw %} d-none{% endif %}">
{% trans "The draw has not started yet." %}
{% if user.registration.is_volunteer %}
<form id="format-form-{{ tournament.id }}">
<div class="col-md-3">
<div class="input-group">
<label class="input-group-text" for="format-{{ tournament.id }}">
{% trans "Configuration:" %}
</label>
<input type="text" class="form-control" id="format-{{ tournament.id }}"
pattern="^[345](\+[345])*$"
placeholder="{{ tournament.best_format }}"
value="{{ tournament.best_format }}">
<button class="btn btn-success input-group-btn">{% trans "Start!" %}</button>
</div>
</div>
</form>
{% endif %}
</div>
<div id="draw-content-{{ tournament.id }}" class="{% if not tournament.draw %}d-none{% endif %}">
<div class="container">
<div class="card col-md-12">
<div class="card-header">
<h2>{% trans "Last dices" %}</h2>
</div>
<div class="card-body">
<div id="dices-{{ tournament.id }}" class="row">
{% for td in tournament.draw.current_round.team_draws %}
<div class="col-md-1" style="order: {{ forloop.counter }};">
<div id="dice-{{ tournament.id }}-{{ td.participation.team.trigram }}"
class="badge rounded-pill text-bg-{% if td.last_dice %}success{% else %}warning{% endif %}"
{% if request.user.registration.is_volunteer %}
onclick="drawDice({{ tournament.id }}, '{{ td.participation.team.trigram }}')"
{% endif %}>
{{ td.participation.team.trigram }} 🎲 {{ td.last_dice|default:'??' }}
</div>
</div>
{% endfor %}
</div>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="card">
<div class="card-header">
Recap
{% if user.registration.is_volunteer %}
<button id="abort-{{ tournament.id }}" class="badge rounded-pill text-bg-danger" onclick="abortDraw({{ tournament.id }})">
{% trans "Abort" %}
</button>
{% endif %}
</div>
<div class="card-body">
<ul id="recap-{{ tournament.id }}-round-list" class="list-group list-group-flush">
{% for round in tournament.draw.round_set.all %}
<li id="recap-{{ tournament.id }}-round-{{ round.number }}"
class="list-group-item {% if tournament.draw.current_round == round %} list-group-item-primary{% endif %}"
data-tournament="{{ tournament.id }}">
<strong>{{ round }}</strong>
<ul id="recap-{{ tournament.id }}-round-{{ round.number }}-pool-list"
class="list-group list-group-flush">
{% for pool in round.pool_set.all %}
<li id="recap-{{ tournament.id }}-round-{{ round.number }}-pool-{{ pool.get_letter_display }}"
class="list-group-item {% if tournament.draw.current_round.current_pool == pool %} list-group-item-success{% endif %}"
data-tournament="{{ tournament.id }}">
<strong>{% trans "pool"|capfirst %} {{ pool }}</strong>
<ul id="recap-{{ tournament.id }}-round-{{ round.number }}-pool-{{ pool.get_letter_display }}-team-list"
class="list-group list-group-flush">
{% for td in pool.team_draws.all %}
<li id="recap-team-{{ td.participation.team.trigram }}"
class="list-group-item{% if tournament.draw.current_round.current_pool.current_team == td %} list-group-item-info{% endif %}"
data-tournament="{{ tournament.id }}">
<div id="recap-team-{{ td.participation.team.trigram }}-accepted"
class="badge rounded-pill text-bg-{% if td.accepted %}success{% else %}warning{% endif %}">
{{ td.participation.team.trigram }} 📃 {{ td.accepted|default:'?' }}
</div>
<div id="recap-team-{{ td.participation.team.trigram }}-rejected"
class="badge rounded-pill text-bg-danger">
🗑️ {{ td.rejected|join:', ' }}
</div>
{% if td.penalty %}
<div id="recap-team-{{ td.participation.team.trigram }}-penalty"
class="badge rounded-pill text-bg-info">
❌ {{ td.penalty }}
</div>
{% endif %}
</li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
</div>
</div>
</div>
<div class="col-md-9">
<div class="card">
<div class="card-body">
<div id="messages-{{ tournament.id }}" class="alert alert-info">
{{ tournament.draw.information|safe }}
</div>
<div id="launch-dice-{{ tournament.id }}"
{% if tournament.draw.get_state != 'DICE_SELECT_POULES' %}{% if tournament.draw.get_state != 'DICE_ORDER_POULE' or user.registration.team.trigram not in tournament.draw.current_round.current_pool.trigrams %}class="d-none"{% endif %}{% endif %}>
<div class="text-center">
<button class="btn btn-lg" style="font-size: 100pt" onclick="drawDice({{ tournament.id }})">
🎲
</button>
</div>
<h2 class="text-center">
{% trans "Launch dice" %}
</h2>
</div>
<div class="d-grid">
<div class="btn-group">
<button class="btn btn-success disabled">
{% trans "Accept" %}
</button>
<button class="btn btn-danger disabled">
{% trans "Decline" %}
</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="tables-{{ tournament.id }}" class="row">
{% for round in tournament.draw.round_set.all %}
<div class="card col-md-6">
<div class="card-header">
<h2>
{{ round }}
</h2>
</div>
<div id="tables-{{ tournament.id }}-round-{{ round.number }}" class="card-body">
{% for pool in round.pool_set.all %}
{% if pool.teamdraw_set.count %}
<div class="card">
<div class="card-header">
<h3>
{% trans "pool"|capfirst %} {{ pool }}
</h3>
</div>
<div class="card-body">
<table id="table-{{ tournament.id }}-{{ round.number }}-{{ pool.get_letter_display }}" class="table table-striped">
<thead>
<tr>
<th class="text-center" rowspan="{% if pool.size == 5 %}3{% else %}2{% endif %}">{% trans "team"|capfirst %}</th>
<th class="text-center"{% if pool.size == 5 %} colspan="2"{% endif %}>Phase 1</th>
<th class="text-center"{% if pool.size == 5 %} colspan="2"{% endif %}>Phase 2</th>
<th class="text-center">Phase 3</th>
{% if pool.size == 4 %}
<th class="text-center">Phase 4</th>
{% endif %}
</tr>
{% if pool.size == 5 %}
<tr>
<th class="text-center">{% trans "Room" %} 1</th>
<th class="text-center">{% trans "Room" %} 2</th>
<th class="text-center">{% trans "Room" %} 1</th>
<th class="text-center">{% trans "Room" %} 2</th>
<th class="text-center">{% trans "Room" %} 1</th>
</tr>
{% endif %}
<tr>
{% for td in pool.team_draws.all %}
<th class="text-center">
Pb.
<span id="table-{{ tournament.id }}-round-{{ round.number }}-problem-{{ td.participation.team.trigram }}">{{ td.accepted|default:"?" }}</span>
</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for td in pool.team_draws %}
<tr>
<td class="text-center">{{ td.participation.team.trigram }}</td>
{% if pool.size == 3 %}
{% if forloop.counter == 1 %}
<td class="text-center">Déf</td>
<td class="text-center">Rap</td>
<td class="text-center">Opp</td>
{% elif forloop.counter == 2 %}
<td class="text-center">Opp</td>
<td class="text-center">Déf</td>
<td class="text-center">Rap</td>
{% elif forloop.counter == 3 %}
<td class="text-center">Rap</td>
<td class="text-center">Opp</td>
<td class="text-center">Déf</td>
{% endif %}
{% elif pool.size == 4 %}
{% if forloop.counter == 1 %}
<td class="text-center">Déf</td>
<td></td>
<td class="text-center">Rap</td>
<td class="text-center">Opp</td>
{% elif forloop.counter == 2 %}
<td class="text-center">Opp</td>
<td class="text-center">Déf</td>
<td></td>
<td class="text-center">Rap</td>
{% elif forloop.counter == 3 %}
<td class="text-center">Rap</td>
<td class="text-center">Opp</td>
<td class="text-center">Déf</td>
<td></td>
{% elif forloop.counter == 4 %}
<td></td>
<td class="text-center">Rap</td>
<td class="text-center">Opp</td>
<td class="text-center">Déf</td>
{% endif %}
{% elif pool.size == 5 %}
{% if forloop.counter == 1 %}
<td class="text-center">Déf</td>
<td></td>
<td class="text-center">Opp</td>
<td class="text-center">Rap</td>
<td></td>
{% elif forloop.counter == 2 %}
<td></td>
<td class="text-center">Déf</td>
<td class="text-center">Rap</td>
<td></td>
<td class="text-center">Opp</td>
{% elif forloop.counter == 3 %}
<td class="text-center">Opp</td>
<td></td>
<td class="text-center">Déf</td>
<td></td>
<td class="text-center">Rap</td>
{% elif forloop.counter == 4 %}
<td class="text-center">Rap</td>
<td class="text-center">Opp</td>
<td></td>
<td class="text-center">Déf</td>
<td></td>
{% elif forloop.counter == 5 %}
<td></td>
<td class="text-center">Rap</td>
<td></td>
<td class="text-center">Opp</td>
<td class="text-center">Déf</td>
<td></td>
{% endif %}
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endif %}
{% endfor %}
</div>
</div>
{% endfor %}
</div>
</div>
</div>