ajout de présence des joueurs sur un matchs
This commit is contained in:
+9
-1
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user