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:
parent
ab459ecc17
commit
60f5236dee
@ -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):
|
||||
|
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user