separate teams list in two block in teams.html

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

@ -10,31 +10,31 @@
{% load static %}
{% include 'tournaments/navigation_tournament.html' %}
{% if teams %}
{% 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>
<div class="bubble">
{% if tournament.registration_count_display %}
<label class="title">{{ tournament.registration_count_display }}</label>
{% for team in selected_teams %}
{% include 'tournaments/team_row.html' %}
{% endfor %}
</div>
{% endif %}
{% for team in teams %}
{% 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 %}
</div>
{% endif %}
</div>
</div>
{% endif %}
{% endblock %}
{% endif %}

@ -271,10 +271,13 @@ def tournament_teams(request, tournament_id):
tournament = get_object_or_404(Tournament, pk=tournament_id)
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', {
'tournament': tournament,
'teams': teams,
'selected_teams': selected_teams,
'waiting_teams': waiting_teams,
})
def tournament_summons(request, tournament_id):

Loading…
Cancel
Save