@@ -70,24 +70,40 @@ layout: layouts/base.njk
7070
7171<section class =" cards" >
7272 <h2 class =" mb-12" >Find a Local User Group</h2 >
73- <ul class =" grid grid-cols-2 lg:grid-cols-3 gap-8" >
73+ <filter-container >
74+ <form class =" pb-4" >
75+ <div class =" pb-2" >
76+ <strong class =" pr-4" >Filter</strong >
77+ <span data-filter-results ></span >
78+ </div >
79+ <label class =" inline-flex pr-4 pb-2" >
80+ <span class =" sr-only" >Country</span >
81+ <select data-filter-bind =" country" class =" text-black py-1 px-2 rounded-default border border-white bg-white" >
82+ <option selected value =" " >All Countries</option >
83+ {%- for country in community | select (" country" ) | flatten | unique | sort (false , false ) %}
84+ <option value =" {{ country | lower }}" >{{ country }} </option >
85+ {%- endfor %}
86+ </select >
87+ </label >
88+ </form >
89+ <ul class =" grid grid-cols-2 lg:grid-cols-3 gap-8" >
90+ {% set themes = [
91+ " bg-gradient-card-sunrise hover:card-shadow-sunrise" ,
92+ " bg-gradient-card-blue hover:card-shadow-blue-seafoam" ,
93+ " bg-gradient-card-seafoam hover:card-shadow-seafoam" ,
94+ " bg-gradient-card-gold hover:card-shadow-gold" ]
95+ %}
96+ {%- for item in community | sort (false , false , ' name' ) %}
7497
75-
76- {% set themes = [
77- " bg-gradient-card-sunrise hover:card-shadow-sunrise" ,
78- " bg-gradient-card-blue hover:card-shadow-blue-seafoam" ,
79- " bg-gradient-card-seafoam hover:card-shadow-seafoam" ,
80- " bg-gradient-card-gold hover:card-shadow-gold" ]
81- %}
82- {%- for item in community | sort (false , false , ' name' ) %}
83-
84- {# chose a pseudorandom theme based on the city name #}
85- {% set theme = item .name .length % 4 %}
86- <li >
87- {{ meetup .card ( item .name , item .link , themes [theme ] ) }}
88- </li >
89- {%- endfor %}
90- </ul >
98+ {# chose a pseudorandom theme based on the city name #}
99+ {% set theme = item .name .length % 4 %}
100+ <li
101+ {%- if item.country %} data-filter-country =" {{ item.country | lower }}" {% endif %} >
102+ {{ meetup .card ( item .name , item .link , themes [theme ] ) }}
103+ </li >
104+ {%- endfor %}
105+ </ul >
106+ </filter-container >
91107</section >
92108
93109<section >
0 commit comments