ajout de présence des joueurs sur un matchs

This commit is contained in:
cedrick2711
2026-07-25 16:25:51 -04:00
parent e9f83709a4
commit de04ecdf11
19 changed files with 242 additions and 40 deletions
+9 -1
View File
@@ -271,6 +271,11 @@ def view_tryout(tryout_id):
matches = Match.query.filter_by(tryout_id=tryout_id).order_by(Match.date, Match.start_time).all()
match_data = []
for match in matches:
# Calculate presence stats
all_participants = list(match.participants.all())
confirmed_count = sum(1 for p in all_participants if p.attendance_confirmed)
total_count = len(all_participants)
if match.match_type == 'team_vs_team':
participants = {
'team1': match.team1.name if match.team1 else 'TBD',
@@ -289,9 +294,12 @@ def view_tryout(tryout_id):
}
else:
participants = [p.player.username for p in match.participants.all()]
match_data.append({
'match': match,
'participants': participants
'participants': participants,
'confirmed_count': confirmed_count,
'total_count': total_count
})
return render_template('pages/view_tryout.html',