froiln1565 commited on
Commit
7d7a39d
·
verified ·
1 Parent(s): ef959b0

On the Participant List Tab, Make the list minimizable for example on the Participant List Titled "SFAT" then there will be a SFAT tab that when I Maximize or click it it will show all participant name. - Follow Up Deployment

Browse files
Files changed (2) hide show
  1. index.html +47 -21
  2. prompts.txt +2 -1
index.html CHANGED
@@ -253,9 +253,9 @@
253
  </div>
254
 
255
  <div id="participantsListContent" class="overflow-y-auto max-h-96">
256
- <div id="participantsList" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
257
- <!-- Participants will be listed here -->
258
- <div class="text-center py-10 text-gray-500 col-span-3">
259
  <i class="fas fa-users text-4xl mb-2"></i>
260
  <p>No participants added yet</p>
261
  </div>
@@ -572,23 +572,18 @@
572
  document.getElementById('photoPreviewContainer').classList.add('hidden');
573
  }
574
 
575
- // Render participants list
576
  function renderParticipantsList() {
577
  const container = document.getElementById('participantsList');
578
- const allParticipants = [];
579
 
580
- trainingPrograms.forEach(program => {
581
- if (program.namedParticipants && program.namedParticipants.length > 0) {
582
- allParticipants.push(...program.namedParticipants.map(name => ({
583
- name: name,
584
- program: program.title
585
- })));
586
- }
587
- });
588
 
589
- if (allParticipants.length === 0) {
590
  container.innerHTML = `
591
- <div class="text-center py-10 text-gray-500 col-span-3">
592
  <i class="fas fa-users text-4xl mb-2"></i>
593
  <p>No participants added yet</p>
594
  </div>
@@ -596,12 +591,43 @@
596
  return;
597
  }
598
 
599
- container.innerHTML = allParticipants.map(participant => `
600
- <div class="bg-gray-50 p-4 rounded-lg border border-gray-200">
601
- <p class="font-medium text-darkgreen-800">${participant.name}</p>
602
- <p class="text-sm text-gray-600 mt-1">From: ${participant.program}</p>
603
- </div>
604
- `).join('');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
605
  }
606
 
607
  // Render training list
 
253
  </div>
254
 
255
  <div id="participantsListContent" class="overflow-y-auto max-h-96">
256
+ <div id="participantsList">
257
+ <!-- Participants will be grouped by program here -->
258
+ <div class="text-center py-10 text-gray-500">
259
  <i class="fas fa-users text-4xl mb-2"></i>
260
  <p>No participants added yet</p>
261
  </div>
 
572
  document.getElementById('photoPreviewContainer').classList.add('hidden');
573
  }
574
 
575
+ // Render participants list grouped by program
576
  function renderParticipantsList() {
577
  const container = document.getElementById('participantsList');
 
578
 
579
+ // Group participants by program
580
+ const programsWithParticipants = trainingPrograms.filter(program =>
581
+ program.namedParticipants && program.namedParticipants.length > 0
582
+ );
 
 
 
 
583
 
584
+ if (programsWithParticipants.length === 0) {
585
  container.innerHTML = `
586
+ <div class="text-center py-10 text-gray-500">
587
  <i class="fas fa-users text-4xl mb-2"></i>
588
  <p>No participants added yet</p>
589
  </div>
 
591
  return;
592
  }
593
 
594
+ container.innerHTML = programsWithParticipants.map(program => {
595
+ const programId = `participants-${program.id}`;
596
+ return `
597
+ <div class="mb-4 border border-gray-200 rounded-lg overflow-hidden">
598
+ <div class="flex justify-between items-center bg-gray-100 p-3 cursor-pointer"
599
+ onclick="toggleParticipantsGroup('${programId}')">
600
+ <h3 class="font-medium text-darkgreen-800">${program.title}</h3>
601
+ <div class="flex items-center">
602
+ <span class="text-sm text-gray-600 mr-2">${program.namedParticipants.length} participants</span>
603
+ <i class="fas fa-chevron-down text-gray-500 transition-transform duration-200" id="icon-${programId}"></i>
604
+ </div>
605
+ </div>
606
+ <div id="${programId}" class="hidden bg-white p-4 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
607
+ ${program.namedParticipants.map(name => `
608
+ <div class="bg-gray-50 p-3 rounded border border-gray-200">
609
+ <p class="font-medium text-darkgreen-800">${name}</p>
610
+ </div>
611
+ `).join('')}
612
+ ${program.unnamedParticipants > 0 ? `
613
+ <div class="bg-gray-100 p-3 rounded border border-gray-200">
614
+ <p class="text-gray-600">+ ${program.unnamedParticipants} unnamed participants</p>
615
+ </div>
616
+ ` : ''}
617
+ </div>
618
+ </div>
619
+ `;
620
+ }).join('');
621
+ }
622
+
623
+ // Toggle participants group visibility
624
+ function toggleParticipantsGroup(id) {
625
+ const group = document.getElementById(id);
626
+ const icon = document.getElementById(`icon-${id}`);
627
+
628
+ group.classList.toggle('hidden');
629
+ icon.classList.toggle('fa-chevron-down');
630
+ icon.classList.toggle('fa-chevron-up');
631
  }
632
 
633
  // Render training list
prompts.txt CHANGED
@@ -13,4 +13,5 @@ add a functionality where if the list of participants is not final yet I can jus
13
  In the Training Programs part Show the Names of the added participants if their name is inputted not just 3 Named put the exact name.
14
  also the list of names on the participants side should be in parallel position.
15
  On the Training Programs Tab make the list the details inputted in Parallel form when it has a parallel input into it, also at the Participants when I add names on the Participants Display also all the actual names of the participants in parallel form also. if there's unnamed participants just put the number of participants below the Named participants.
16
- can you make a separate Tab for the List of Participants added by name. make it also minimizable.
 
 
13
  In the Training Programs part Show the Names of the added participants if their name is inputted not just 3 Named put the exact name.
14
  also the list of names on the participants side should be in parallel position.
15
  On the Training Programs Tab make the list the details inputted in Parallel form when it has a parallel input into it, also at the Participants when I add names on the Participants Display also all the actual names of the participants in parallel form also. if there's unnamed participants just put the number of participants below the Named participants.
16
+ can you make a separate Tab for the List of Participants added by name. make it also minimizable.
17
+ On the Participant List Tab, Make the list minimizable for example on the Participant List Titled "SFAT" then there will be a SFAT tab that when I Maximize or click it it will show all participant name.