From e6caf1bb568f9fba2de3e01f05ada64732e9e16a Mon Sep 17 00:00:00 2001 From: Raz Date: Mon, 24 Feb 2025 08:38:09 +0100 Subject: [PATCH] separate teams list in two block in teams.html --- tournaments/templates/tournaments/teams.html | 34 ++++++++++---------- tournaments/views.py | 5 ++- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/tournaments/templates/tournaments/teams.html b/tournaments/templates/tournaments/teams.html index 0466c98..f978b62 100644 --- a/tournaments/templates/tournaments/teams.html +++ b/tournaments/templates/tournaments/teams.html @@ -10,31 +10,31 @@ {% load static %} - {% include 'tournaments/navigation_tournament.html' %} +{% include 'tournaments/navigation_tournament.html' %} +
+
+ {% if selected_teams|length > 0 %} + - {% if teams %} - -
- -
- {% if tournament.registration_count_display %} - - {% endif %} + {% for team in selected_teams %} + {% include 'tournaments/team_row.html' %} + {% endfor %} - {% for team in teams %} +
+ {% endif %} - {% include 'tournaments/team_row.html' %} + {% if waiting_teams|length > 0 %} + +
+ {% for team in waiting_teams %} + {% include 'tournaments/team_row.html' %} {% endfor %} -
-
- + {% endif %}
- - {% endif %} - +
{% endblock %} {% endif %} diff --git a/tournaments/views.py b/tournaments/views.py index ae0cbb0..c041b47 100644 --- a/tournaments/views.py +++ b/tournaments/views.py @@ -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):