diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py index 100ffce..27d927e 100644 --- a/tournaments/models/tournament.py +++ b/tournaments/models/tournament.py @@ -124,7 +124,10 @@ class Tournament(models.Model): else: return None - def team_count_display(self): + def tournament_status_display(self): + #if self.is_canceled: + # return "Annulé" + teams = self.teams() if teams is not None and len(teams) > 0: return f"{len(teams)} inscriptions" diff --git a/tournaments/templates/tournaments/tournament_row.html b/tournaments/templates/tournaments/tournament_row.html index 1a64ac0..8cd564f 100644 --- a/tournaments/templates/tournaments/tournament_row.html +++ b/tournaments/templates/tournaments/tournament_row.html @@ -22,13 +22,13 @@ {% endif %} - {% if tournament.team_count_display %} -
{{ tournament.team_count_display }}
+ {% if tournament.tournament_status_display %} +
{{ tournament.tournament_status_display }}
{% endif %}
{{ tournament.formatted_start_date }}
- {% if tournament.team_count_display %} -
{{ tournament.team_count_display }}
+ {% if tournament.tournament_status_display %} +
{{ tournament.tournament_status_display }}
{% endif %}
diff --git a/tournaments/views.py b/tournaments/views.py index 91cd2a5..ee55afb 100644 --- a/tournaments/views.py +++ b/tournaments/views.py @@ -65,7 +65,7 @@ def index(request): if tournament.supposedly_in_progress() and tournament.display_tournament(): live_tournaments.append(tournament) - ended_tournaments = Tournament.objects.filter(*q_ended).order_by('start_date') + ended_tournaments = Tournament.objects.filter(*q_ended).order_by('-start_date') filtered_ended_tournaments = [] for tournament in ended_tournaments: