1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-05-01 18:51:33 +00:00

Affichage du tournoi dans la liste des réponses à un questionnaire

This commit is contained in:
Emmy D'Anello 2025-04-28 20:35:23 +02:00
parent ab459ecc17
commit 60f5236dee
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
2 changed files with 5 additions and 2 deletions

View File

@ -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):

View File

@ -48,6 +48,7 @@
<thead>
<tr>
<th>{% trans "participant"|capfirst %}</th>
<th>{% trans "tournament"|capfirst %}</th>
<th>{% trans "completed"|capfirst %}</th>
</tr>
</thead>
@ -56,8 +57,10 @@
<tr class="{% if participant in survey.completed.all %}table-success{% else %}table-danger{% endif %}">
{% if survey.invite_team %}
<td>{% trans "Team" %} {{ participant.name }} ({{ participant.trigram }})</td>
<td>{{ participant.participation.tournament.name }}</td>
{% else %}
<td>{{ participant.user.first_name }} {{ participant.user.last_name }} ({% trans "team" %} {{ participant.team.trigram }})</td>
<td>{{ participant.team.participation.tournament.name }}</td>
{% endif %}
{% if participant in survey.completed.all %}
<td>{% trans "Yes" %}</td>