diff --git a/survey/models.py b/survey/models.py index 4ada6fa..696f3fe 100644 --- a/survey/models.py +++ b/survey/models.py @@ -70,7 +70,7 @@ class Survey(models.Model): teams = Team.objects.filter(participation__valid=True) if self.tournament: teams = teams.filter(participation__tournament=self.tournament) - return teams.all() + return teams.order_by('participation__tournament__name', 'trigram').all() else: if self.invite_coaches: registrations = ParticipantRegistration.objects.filter(team__participation__valid=True) @@ -78,7 +78,7 @@ class Survey(models.Model): registrations = StudentRegistration.objects.filter(team__participation__valid=True) if self.tournament: registrations = registrations.filter(team__participation__tournament=self.tournament) - return registrations.all() + return registrations.order_by('team__participation__tournament__name', 'team__trigram').all() @property def completed(self): diff --git a/survey/templates/survey/survey_detail.html b/survey/templates/survey/survey_detail.html index ca3be9b..14df805 100644 --- a/survey/templates/survey/survey_detail.html +++ b/survey/templates/survey/survey_detail.html @@ -48,6 +48,7 @@ {% trans "participant"|capfirst %} + {% trans "tournament"|capfirst %} {% trans "completed"|capfirst %} @@ -56,8 +57,10 @@ {% if survey.invite_team %} {% trans "Team" %} {{ participant.name }} ({{ participant.trigram }}) + {{ participant.participation.tournament.name }} {% else %} {{ participant.user.first_name }} {{ participant.user.last_name }} ({% trans "team" %} {{ participant.team.trigram }}) + {{ participant.team.participation.tournament.name }} {% endif %} {% if participant in survey.completed.all %} {% trans "Yes" %}