@@ -170,7 +170,7 @@ <h1 class="text-4xl md:text-5xl font-extrabold text-gray-800 tracking-tight">Can
170170 < label for ="text-search-input " class ="sr-only "> Search workshops by keyword</ label >
171171 < input type ="search " id ="text-search-input " placeholder ="Search workshops... " class ="w-full sm:w-48 px-4 py-2.5 border border-gray-300 rounded-lg shadow-sm focus:ring-brand-purple focus:border-brand-purple transition ">
172172 </ div >
173- </ div >
173+ </ div >
174174
175175 < main id ="link-container " class ="space-y-16 ">
176176 < div id ="no-results-message " class ="hidden " role ="status " aria-live ="polite ">
@@ -205,7 +205,9 @@ <h3 class="mt-2 text-xl font-semibold text-gray-900">No workshops found</h3>
205205 title : { container : null , active : new Set ( ) , label : "Workshop" } ,
206206 tags : { container : null , active : new Set ( ) , label : "Topics" } ,
207207 format : { container : null , active : new Set ( ) , label : "Format" } ,
208- status : { container : null , active : new Set ( ) , label : "Status" }
208+ status : { container : null , active : new Set ( ) , label : "Status" } ,
209+ // NEW FILTER ADDED
210+ materials : { container : null , active : new Set ( ) , label : "Materials" }
209211 } ;
210212
211213 function formatDateRange ( startDateStr , endDateStr ) {
@@ -225,12 +227,12 @@ <h3 class="mt-2 text-xl font-semibold text-gray-900">No workshops found</h3>
225227 const workshopStartDate = new Date ( link . startDate + 'T00:00:00' ) ;
226228 const workshopEndDate = new Date ( link . endDate + 'T00:00:00' ) ;
227229 const isPastWorkshop = workshopEndDate < today ;
228- const hasNoUrl = ( ! link . url || link . url = == "" ) ;
230+ const hasUrl = ( link . url && link . url ! == "" ) ;
229231
230232 // Determine if this card should have the 'past-no-materials' behavior (permanent graying, MNA overlay)
231- const applyPastNoMaterialsBehavior = isPastWorkshop && hasNoUrl ;
233+ const applyPastNoMaterialsBehavior = isPastWorkshop && ! hasUrl ;
232234 // Determine if this card needs the "Materials Coming Soon" overlay
233- const applyComingSoonOverlay = ! isPastWorkshop && hasNoUrl ;
235+ const applyComingSoonOverlay = ! isPastWorkshop && ! hasUrl ;
234236
235237 // Apply 'past-no-materials' class for permanent grayscale and potential hover background
236238 const cardClassSuffix = applyPastNoMaterialsBehavior ? ' past-no-materials hover:bg-gray-100' : '' ;
@@ -272,6 +274,9 @@ <h3 class="mt-2 text-xl font-semibold text-gray-900">No workshops found</h3>
272274 }
273275 card . dataset . status = JSON . stringify ( statusTags ) ;
274276
277+ // Set materials status for filtering
278+ card . dataset . materials = JSON . stringify ( hasUrl ? [ "Available" ] : [ "Not Available" ] ) ;
279+
275280
276281 const sortedRegions = [ ...link . regions ] . sort ( ( a , b ) => regionOrder . indexOf ( a ) - regionOrder . indexOf ( b ) ) ;
277282
@@ -282,7 +287,7 @@ <h3 class="mt-2 text-xl font-semibold text-gray-900">No workshops found</h3>
282287 return `<span class="flex items-center justify-center ${ lightBgClass } text-gray-900 border-2 ${ borderClass } rounded-full px-3 py-1 text-xs font-bold shadow-sm" title="Region: ${ region } ">${ region } </span>` ;
283288 } ) . join ( '' ) ;
284289
285- const regionColors = sortedRegions . map ( region => tailwind . config . theme . extend . colors [ `region-${ region . toLowerCase ( ) } ` ] ) . filter ( Boolean ) ;
290+ const regionColors = sortedRegions . map ( region => tailwind . config . theme . extend . colors [ `region-${ region . toLowerCase ( ) . replace ( ' ' , '-' ) } ` ] ) . filter ( Boolean ) ;
286291 let colorBarHTML = '<div class="h-1.5 bg-gray-300"><span class="sr-only">Workshop regions color bar</span></div>' ;
287292 if ( regionColors . length > 1 ) {
288293 // Color bar will be permanently grayscale if applyPastNoMaterialsBehavior is true (CSS handles this)
@@ -305,7 +310,6 @@ <h3 class="mt-2 text-xl font-semibold text-gray-900">No workshops found</h3>
305310 const imageHoverEffectClass = applyPastNoMaterialsBehavior ? '' : 'transition-all duration-300' ; // No extra hover classes needed here, CSS handles static grayscale.
306311
307312 // No materials status tag for past-no-materials
308- let materialsStatusTagHTML = '' ;
309313 let titleAriaLabelSuffix = '' ;
310314
311315 // Overlay for "Materials Coming Soon" or "Materials Not Available"
@@ -355,7 +359,7 @@ <h3 class="text-lg font-bold ${applyPastNoMaterialsBehavior ? 'text-gray-600' :
355359 </div>
356360 ` ;
357361
358- if ( link . url ) {
362+ if ( hasUrl ) {
359363 // If URL exists, wrap the entire visual content in an <a> tag
360364 card . innerHTML = `
361365 <a href="${ link . url } " target="_blank" rel="noopener noreferrer"
@@ -468,6 +472,7 @@ <h3 class="text-lg font-bold ${applyPastNoMaterialsBehavior ? 'text-gray-600' :
468472 document . querySelectorAll ( '.card' ) . forEach ( card => {
469473 const searchMatch = ! searchTerm || card . dataset . search . includes ( searchTerm ) ;
470474 let filtersMatch = true ;
475+
471476 for ( const type in allFilters ) {
472477 if ( allFilters [ type ] . active . size === 0 ) continue ;
473478
@@ -478,6 +483,7 @@ <h3 class="text-lg font-bold ${applyPastNoMaterialsBehavior ? 'text-gray-600' :
478483 break ;
479484 }
480485 }
486+
481487 if ( searchMatch && filtersMatch ) {
482488 card . classList . remove ( 'hidden' ) ;
483489 totalVisibleCards ++ ;
@@ -507,7 +513,9 @@ <h3 class="text-lg font-bold ${applyPastNoMaterialsBehavior ? 'text-gray-600' :
507513 title : [ ...new Set ( linksData . map ( link => link . title ) ) ] . sort ( ) ,
508514 tags : [ ...new Set ( linksData . flatMap ( link => link . tags ) ) ] . sort ( ) ,
509515 format : [ ...new Set ( linksData . map ( link => link . format ) ) ] . sort ( ) ,
510- status : [ "Upcoming" , "Happening Now" , "Past" ]
516+ status : [ "Upcoming" , "Happening Now" , "Past" ] ,
517+ // NEW OPTION ADDED
518+ materials : [ "Available" ]
511519 } ;
512520
513521 for ( const type in allFilters ) {
@@ -651,5 +659,16 @@ <h3 class="text-lg font-bold ${applyPastNoMaterialsBehavior ? 'text-gray-600' :
651659 border-width : 0 ;
652660}
653661</ style >
662+
663+ < footer class ="mt-16 py-8 px-4 text-center text-sm text-gray-600 bg-slate-50 border-t border-gray-200 ">
664+ < p >
665+ Many CBW workshops are archived. If you are looking for material from a workshop not available here,
666+ email us at
667+ < a href ="mailto:training@bioinformatics.ca " class ="text-brand-purple hover:text-purple-700 font-semibold transition-colors duration-200 ">
668+ training@bioinformatics.ca
669+ </ a > .
670+ </ p >
671+ </ footer >
672+
654673</ body >
655674</ html >
0 commit comments