mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-05-02 04:51:32 +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)
|
teams = Team.objects.filter(participation__valid=True)
|
||||||
if self.tournament:
|
if self.tournament:
|
||||||
teams = teams.filter(participation__tournament=self.tournament)
|
teams = teams.filter(participation__tournament=self.tournament)
|
||||||
return teams.all()
|
return teams.order_by('participation__tournament__name', 'trigram').all()
|
||||||
else:
|
else:
|
||||||
if self.invite_coaches:
|
if self.invite_coaches:
|
||||||
registrations = ParticipantRegistration.objects.filter(team__participation__valid=True)
|
registrations = ParticipantRegistration.objects.filter(team__participation__valid=True)
|
||||||
@ -78,7 +78,7 @@ class Survey(models.Model):
|
|||||||
registrations = StudentRegistration.objects.filter(team__participation__valid=True)
|
registrations = StudentRegistration.objects.filter(team__participation__valid=True)
|
||||||
if self.tournament:
|
if self.tournament:
|
||||||
registrations = registrations.filter(team__participation__tournament=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
|
@property
|
||||||
def completed(self):
|
def completed(self):
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{% trans "participant"|capfirst %}</th>
|
<th>{% trans "participant"|capfirst %}</th>
|
||||||
|
<th>{% trans "tournament"|capfirst %}</th>
|
||||||
<th>{% trans "completed"|capfirst %}</th>
|
<th>{% trans "completed"|capfirst %}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@ -56,8 +57,10 @@
|
|||||||
<tr class="{% if participant in survey.completed.all %}table-success{% else %}table-danger{% endif %}">
|
<tr class="{% if participant in survey.completed.all %}table-success{% else %}table-danger{% endif %}">
|
||||||
{% if survey.invite_team %}
|
{% if survey.invite_team %}
|
||||||
<td>{% trans "Team" %} {{ participant.name }} ({{ participant.trigram }})</td>
|
<td>{% trans "Team" %} {{ participant.name }} ({{ participant.trigram }})</td>
|
||||||
|
<td>{{ participant.participation.tournament.name }}</td>
|
||||||
{% else %}
|
{% else %}
|
||||||
<td>{{ participant.user.first_name }} {{ participant.user.last_name }} ({% trans "team" %} {{ participant.team.trigram }})</td>
|
<td>{{ participant.user.first_name }} {{ participant.user.last_name }} ({% trans "team" %} {{ participant.team.trigram }})</td>
|
||||||
|
<td>{{ participant.team.participation.tournament.name }}</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if participant in survey.completed.all %}
|
{% if participant in survey.completed.all %}
|
||||||
<td>{% trans "Yes" %}</td>
|
<td>{% trans "Yes" %}</td>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user