@@ -98,7 +98,7 @@ const profiles = await getProfilesFromNames(meeting.credit);
>
- ) : isMaybeUpcoming && meeting.live_video_url ? (
+ ) : isMaybeActive && meeting.live_video_url ? (
= 0; i--) {
- const maybeUpcomingMeeting = maybeUpcomingMeetings[i];
- const timeCloseStr = maybeUpcomingMeeting.getAttribute('data-time-close');
- if (!timeCloseStr) {
+ const allMaybeActive = meetingsIndex.querySelectorAll('[data-maybe-active="true"]');
+ var countLive = 0;
+ var countUpcoming = 0;
+ for (let i = allMaybeActive.length - 1; i >= 0; i--) {
+ const maybeActive = allMaybeActive[i];
+ const timeStartStr = maybeActive.getAttribute('data-time-start');
+ const timeCloseStr = maybeActive.getAttribute('data-time-close');
+ if (!timeStartStr || !timeCloseStr) {
continue;
}
+ const timeStart = parseInt(timeStartStr);
const timeClose = parseInt(timeCloseStr);
const now = Date.now();
- if (now < timeClose) {
- maybeUpcomingMeeting.setAttribute('data-is-upcoming', 'true');
- if (upcomingMeetingsList) {
- upcomingMeetingsList.appendChild(maybeUpcomingMeeting);
- }
- if (upcomingMeetingsSection) {
- upcomingMeetingsSection.classList.remove('hidden');
+ if (now >= timeClose) {
+ continue;
+ }
+ maybeActive.setAttribute('data-is-active', 'true');
+ if (now >= timeStart && liveMeetingsList) {
+ countLive++;
+ liveMeetingsList.appendChild(maybeActive);
+ } else if (upcomingMeetingsList) {
+ countUpcoming++;
+ upcomingMeetingsList.appendChild(maybeActive);
+ }
+ }
+ if (activeMeetingsSection && (countLive || countUpcoming)) {
+ const activeMeetingsTitle = document.getElementById('active-meetings-title');
+ if (activeMeetingsTitle) {
+ activeMeetingsTitle.textContent = countLive && countUpcoming
+ ? 'Live & Upcoming'
+ : countLive
+ ? 'Live'
+ : 'Upcoming';
+ }
+ if (countUpcoming > 3) {
+ const label = document.getElementById('upcoming-visibility-toggle-label');
+ const input = document.getElementById('upcoming-visibility-toggle-input');
+ if (label && input) {
+ label.style.display = 'block';
+ input.style.display = 'block';
}
}
+ activeMeetingsSection.classList.remove('hidden');
}
};
document.addEventListener('astro:page-load', initMeetingsIndex);
-
{semesterMetadata?.activeMeetings ? (
- {/*
-
-
- Specific meeting times and locations may vary. Make sure to check individual meeting details.
-
-
*/}
{semesterMetadata.activeMeetings.map((activeMeeting) => (
@@ -159,17 +193,36 @@ const isAllIndex = props.currLink.semester === 'all';
)}
{!isAllIndex ? (
) : null}