espace
This commit is contained in:
parent
d00a1285c5
commit
255f877173
@ -101,6 +101,7 @@ def display_participants():
|
||||
participants = fetch_api('participants')
|
||||
print("Participants: " + str(participants))
|
||||
records = []
|
||||
|
||||
for participant in participants.get_all():
|
||||
records.append(participant)
|
||||
return render_template('participants/participants_list.html', records=records)
|
||||
@ -240,7 +241,27 @@ def show_workshops(module_id):
|
||||
participants_presents = [ participant for participant in participants.get_all() if participant['id'] in modules.get(module_id)['fields']['Participants présents']]
|
||||
|
||||
return render_template('/airtable/workshops/workshops.html', module = module, workshops = workshops, intervenants = intervenants, participants = participants_prevus, presents = participants_presents)
|
||||
|
||||
|
||||
############## affichage des participants par module session d'un prof
|
||||
@airtable_bp.route('/participants/module/<module_id>', methods=['GET'])
|
||||
@auth_required()
|
||||
def display_module_participants(module_id, intervenant_id):
|
||||
modules = fetch_api('modules')
|
||||
# Authentifier l'utilisateur pour déterminer son rôle (professeur ou autre)
|
||||
user = current_user()
|
||||
|
||||
# Vérifier si l'utilisateur est un professeur
|
||||
if user.role == 'prof':
|
||||
module = modules.get(module_id,intervenant_id)
|
||||
if module:
|
||||
# Récupérer la liste des participants prévus pour ce module
|
||||
participants = fetch_api('participants')
|
||||
participants_prevus = [participants.get(participant_id)['fields']['Nom'] for participant_id in module['fields']['Participants prévus']]
|
||||
|
||||
return render_template('module_participants.html', participants=participants_prevus)
|
||||
else:
|
||||
return "Accès non autorisé"
|
||||
|
||||
|
||||
######### Affichage de la fiche d'une séance
|
||||
@airtable_bp.route('/modules/<module_id>/workshops/<workshop_id>', methods=['GET', 'POST'])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user