@@ -486,13 +486,13 @@ import type { Course } from "../../types/schedule";
486486 const displayModalContent = (course) => {
487487 if (! modalElement || ! course ) return ;
488488
489- const modalTitleEl = modalElement .querySelector (" #modalTitle" );
490- const modalSubtitleEl = modalElement .querySelector (" #modalSubtitle" );
491- const modalDescriptionEl = modalElement .querySelector (" #modalDescription" );
492- const linksContainerEl = modalElement .querySelector (" #modalLinks" );
493- const speakerSectionTitleEl = modalElement .querySelector (" #speakerSectionTitle" );
494- const speakerDescriptionEl = modalElement .querySelector (" #speakerDescription" );
495- const modalPersonImageEl = modalElement .querySelector (" #modalPersonImage" );
489+ const modalTitleEl = modalElement .querySelector (" #modalTitle" ) as HTMLElement ;
490+ const modalSubtitleEl = modalElement .querySelector (" #modalSubtitle" ) as HTMLElement ;
491+ const modalDescriptionEl = modalElement .querySelector (" #modalDescription" ) as HTMLElement ;
492+ const linksContainerEl = modalElement .querySelector (" #modalLinks" ) as HTMLElement ;
493+ const speakerSectionTitleEl = modalElement .querySelector (" #speakerSectionTitle" ) as HTMLElement ;
494+ const speakerDescriptionEl = modalElement .querySelector (" #speakerDescription" ) as HTMLElement ;
495+ const modalPersonImageEl = modalElement .querySelector (" #modalPersonImage" ) as HTMLImageElement ;
496496
497497 if (modalTitleEl ) modalTitleEl .textContent = course .title_zh ?.split (" \n " )[0 ] || " " ;
498498 if (modalSubtitleEl ) modalSubtitleEl .textContent = course .title_zh ?.split (" \n " )[1 ] || " " ;
@@ -502,8 +502,25 @@ import type { Course } from "../../types/schedule";
502502 if (speakerSectionTitleEl ) speakerSectionTitleEl .style .display = " none" ;
503503 if (speakerDescriptionEl ) speakerDescriptionEl .style .display = " none" ;
504504 if (modalPersonImageEl ) modalPersonImageEl .style .display = " none" ;
505+ } else if (course .type === " Community" ) {
506+ // Handle Community type events - show booth list instead of speakers
507+ if (speakerSectionTitleEl ) {
508+ speakerSectionTitleEl .style .display = " block" ;
509+ speakerSectionTitleEl .textContent = " 攤位列表" ;
510+ }
511+ if (speakerDescriptionEl ) {
512+ speakerDescriptionEl .style .display = " block" ;
513+ if (course .expo && Array .isArray (course .expo ) && course .expo .length > 0 ) {
514+ const boothList = course .expo .map (booth => ` <li>${booth }</li> ` ).join (" " );
515+ speakerDescriptionEl .innerHTML = ` <ul style="list-style-type: disc; padding-left: 1.5rem; line-height: 1.6;">${boothList }</ul> ` ;
516+ } else {
517+ speakerDescriptionEl .innerHTML = " 暫無攤位資訊" ;
518+ }
519+ speakerDescriptionEl .classList .add (" description-text" );
520+ }
521+ if (modalPersonImageEl ) modalPersonImageEl .style .display = " none" ;
505522 } else {
506- // Show speaker section for non-Game events
523+ // Show speaker section for non-Game and non-Community events
507524 if (speakerSectionTitleEl ) speakerSectionTitleEl .style .display = " block" ;
508525 if (speakerDescriptionEl ) speakerDescriptionEl .style .display = " block" ;
509526
@@ -551,12 +568,12 @@ import type { Course } from "../../types/schedule";
551568
552569 if (speakersWithDesc .length > 0 ) {
553570 speakerDescriptionEl .innerHTML = speakersWithDesc .map (speaker => {
554- const imageHtml = speaker .id ? ` <img src="/2025/speakers/${speaker .id }.webp" alt="${speaker .name }" class="speaker-inline-image" onerror="this.style.display='none';" > ` : " " ;
571+ const imageHtml = speaker .id ? ` <img src="/2025/speakers/${speaker .id }.webp" alt="${speaker .name }" class="speaker-inline-image"> ` : " " ;
555572 return ` <div class="speaker-name emfont-NotoSansTC-600">${imageHtml }<span>${speaker .name }</span></div>${renderMarkdown (speaker .desc )} ` ;
556573 }).join (" " );
557574 } else if (speakerText ) {
558575 speakerDescriptionEl .innerHTML = speakers .map (speaker => {
559- const imageHtml = speaker .id ? ` <img src="/2025/speakers/${speaker .id }.webp" alt="${speaker .name }" class="speaker-inline-image" onerror="this.style.display='none';" > ` : " " ;
576+ const imageHtml = speaker .id ? ` <img src="/2025/speakers/${speaker .id }.webp" alt="${speaker .name }" class="speaker-inline-image"> ` : " " ;
560577 return ` <div class="speaker-name emfont-NotoSansTC-600">${imageHtml }<span>${speaker .name }</span></div> ` ;
561578 }).join (" " ) + ` <p>${speakerText }是本課程的講師。<br>其他資訊可能得等你自己通靈</p> ` ;
562579 }
0 commit comments