ajout d'un paneau admin
This commit is contained in:
+14
-2
@@ -104,7 +104,7 @@ def api_events():
|
||||
one_on_ones = []
|
||||
|
||||
for ooo in one_on_ones:
|
||||
events.append({
|
||||
event = {
|
||||
'id': f'one_on_one_{ooo.id}',
|
||||
'title': f'1:1 - {ooo.player.full_name} & {ooo.coach.full_name}',
|
||||
'date': ooo.date.strftime('%Y-%m-%d'),
|
||||
@@ -117,8 +117,20 @@ def api_events():
|
||||
'start_time': ooo.start_time.strftime('%H:%M') if ooo.start_time else None,
|
||||
'end_time': ooo.end_time.strftime('%H:%M') if ooo.end_time else None,
|
||||
'participants': f"{ooo.player.full_name} with {ooo.coach.full_name}",
|
||||
'player_name': ooo.player.full_name,
|
||||
'coach_name': ooo.coach.full_name,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
# Provide real start/end datetimes so FullCalendar places the event
|
||||
# in the correct time slot (Week/Day views) instead of all-day.
|
||||
if ooo.start_time and ooo.end_time:
|
||||
start_dt = datetime.combine(ooo.date, ooo.start_time)
|
||||
end_dt = datetime.combine(ooo.date, ooo.end_time)
|
||||
event['start'] = start_dt.isoformat()
|
||||
event['end'] = end_dt.isoformat()
|
||||
|
||||
events.append(event)
|
||||
|
||||
return jsonify(events)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user