separate teams list in two block in teams.html

bracket-feature
Raz 9 months ago
parent eea4c69b4a
commit e6caf1bb56
  1. 34
      tournaments/templates/tournaments/teams.html
  2. 5
      tournaments/views.py

@ -10,31 +10,31 @@
{% load static %} {% load static %}
{% include 'tournaments/navigation_tournament.html' %} {% include 'tournaments/navigation_tournament.html' %}
<div class="grid-x padding-bottom">
<div class="cell medium-6 large-6 my-block">
{% if selected_teams|length > 0 %}
<label class="title topmargin20">Équipes sélectionnées : {{ selected_teams|length }}</label>
{% if teams %}
<div class="grid-x padding-bottom">
<div class="cell medium-6 large-6 my-block">
<div class="bubble"> <div class="bubble">
{% if tournament.registration_count_display %} {% for team in selected_teams %}
<label class="title">{{ tournament.registration_count_display }}</label> {% include 'tournaments/team_row.html' %}
{% endif %} {% endfor %}
{% for team in teams %} </div>
{% endif %}
{% include 'tournaments/team_row.html' %} {% if waiting_teams|length > 0 %}
<label class="title topmargin20">Équipes en attente : {{ waiting_teams|length }}</label>
<div class="bubble">
{% for team in waiting_teams %}
{% include 'tournaments/team_row.html' %}
{% endfor %} {% endfor %}
</div> </div>
</div> {% endif %}
</div> </div>
</div>
{% endif %}
{% endblock %} {% endblock %}
{% endif %} {% endif %}

@ -271,10 +271,13 @@ def tournament_teams(request, tournament_id):
tournament = get_object_or_404(Tournament, pk=tournament_id) tournament = get_object_or_404(Tournament, pk=tournament_id)
teams = tournament.teams(True) teams = tournament.teams(True)
selected_teams = [team for team in teams if team.stage != 'Attente']
waiting_teams = [team for team in teams if team.stage == 'Attente']
return render(request, 'tournaments/teams.html', { return render(request, 'tournaments/teams.html', {
'tournament': tournament, 'tournament': tournament,
'teams': teams, 'selected_teams': selected_teams,
'waiting_teams': waiting_teams,
}) })
def tournament_summons(request, tournament_id): def tournament_summons(request, tournament_id):

Loading…
Cancel
Save