#if (!$keys.isEmpty())
#set ($key = $keys[0])
#set ($school = $schools[$key])
<article class="af-openHouse">
<p>Test</p>
    #if ($school.data && $school.data.keys && !$school.data.keys.isEmpty())
    <ul class="af-openHouse__items sol-openHouse__items-list">
        #foreach ($key in $school.data.keys)
        #set ($item = $school.data.dates[$key])
        
        #set ($text = $endecUtil.encodeURL("Öppet hus "))
        #set ($locationTemp = "$!{school.address}, $!{school.name}")
        #set ($locationReal = $endecUtil.encodeURL($locationTemp))
        #set ($datesTime = $key.substring(8, 12))
        #set ($dates = $key.substring(0,8))
        
        <li class="sol-open-house-list-item">
         <a href="data:text/calendar;charset=utf8,BEGIN:VCALENDAR%0AVERSION:2.0%0ABEGIN:VEVENT%0AURL:https://www.Kunskapsgymnasiet.se/confirmed?%0ADTSTART:${dates}T${datesTime}00%0ADTEND:${dates}T${item.endHour}:${item.endMinute}00%0ASUMMARY:Öppet-hus-$!{school.name}%0ALOCATION:$locationTemp%0AEND:VEVENT%0AEND:VCALENDAR" title="Lägg till öppet hus för $!{school.name}, $!{item.day} $!{item.month} kl. $!{item.startHour}:$!{item.startMinute} i min kalender">
            <div class="af-openHouse__item__date sol-openHouse__item__date">
                <h3>Öppet hus</h3>
            </div>
            <div class="af-openHouse__item__time sol-openHouse__item__time">
                #if($item.dayName)$!{item.dayName}, #end $!{item.day} $!{item.month}#if ($item.year != $thisYear) $!{item.year}#end $!{item.startHour}:$!{item.startMinute} <!--&ndash; $!{item.endHour}:$!{item.endMinute}-->
            </div>
               <!-- #if ($item.description)
               <div class="af-openHouse__item__description">
                   $!{item.description}
               </div>
               #end -->
            </a>
            <div class="sol-save-to-calendar-wrapper">
                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="#0080A3" class="bi bi-calendar4" viewBox="0 0 16 16">
                  <path d="M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM2 2a1 1 0 0 0-1 1v1h14V3a1 1 0 0 0-1-1H2zm13 3H1v9a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V5z"/>
                </svg>
                <p class="sol-save-to-calendar normal" style="font-size:16px; padding-left:49px"><a href="data:text/calendar;charset=utf8,BEGIN:VCALENDAR%0AVERSION:2.0%0ABEGIN:VEVENT%0AURL:https://www.Kunskapsgymnasiet.se/confirmed?%0ADTSTART:${dates}T${datesTime}00%0ADTEND:${dates}T${item.endHour}:${item.endMinute}00%0ASUMMARY:Öppet-hus-$!{school.name}%0ALOCATION:$locationTemp%0AEND:VEVENT%0AEND:VCALENDAR" title="Spara tiden $!{item.startHour}:$!{item.startMinute} &ndash; $!{item.endHour}:$!{item.endMinute} i min kalender">Spara i kalender</a></p>
            </div>
          </li>
        #end
    </ul>
    #else
    <div class="af-openHouse__empty">
        Just nu finns inga aktuella datum
    </div>
    #end
</article>
#end
