<#list listDays as day>
<@table>
<@tableHead>
<@tr>
<@th>
#i18n{${list_days_of_week[day_index]}}
${day.date?date}
@th>
@tr>
@tableHead>
<@tableBody>
<#assign currentTime = startingTime />
<#assign currentMinute = startingMinute />
<#assign currentHour = startingHour />
<#if day.listAppointmentResourceDTO?has_content>
<#list day.listAppointmentResourceDTO as appointment>
<#assign nbOccur = ( ( ( appointment.startingHour * 60 + appointment.startingMinute ) - currentTime ) / duration)?round />
<#if nbOccur > 0>
<#list 1..nbOccur as i>
<@updateCurrentTimeHourAndMinute durationApp=duration />
#list>
#if>
<@tr>
<@updateCurrentTimeHourAndMinute durationApp=appointment.duration />
<@td class="bg-primary-subtle">
@td>
@tr>
#list>
<#else>
<@tr>
<@td class="text-muted">
#i18n{module.appointment.resource.labelNoAppointment}
@td>
@tr>
#if>
@tableBody>
@table>
#list>
<@table>
<@tr>
<@td>
<@table>
<@tr>
<@td> @td>
@tr>
<#assign nbOccur = ( ( endingTime - startingTime ) / duration)?round />
<#assign currentTime = startingTime />
<#assign currentMinute = startingMinute />
<#assign currentHour = startingHour />
<#list 1..nbOccur as i>
<@tr>
<@td>
<#if currentHour < 10>0#if>${currentHour}h<#if currentMinute < 10>0#if>${currentMinute}
<@updateCurrentTimeHourAndMinute durationApp=duration />
@td>
@tr>
#list>
@table>
@td>
<#list listDays as day>
<@td>
<@table class="mb-0">
<@tableHead>
<@tr>
<@th>
#i18n{${list_days_of_week[day_index]}}
${day.date?date}
@th>
@tr>
@tableHead>
<@tableBody>
<#assign currentTime = startingTime />
<#assign currentMinute = startingMinute />
<#assign currentHour = startingHour />
<#list day.listAppointmentResourceDTO as appointment>
<#assign nbOccur = ( ( ( appointment.startingHour * 60 + appointment.startingMinute ) - currentTime ) / duration)?round />
<#if nbOccur > 0>
<#list 1..nbOccur as i>
<@addEmptyLine durationApp=duration />
#list>
#if>
<@tr>
<#assign rowspan=((appointment.duration)/duration)?round>
<@updateCurrentTimeHourAndMinute durationApp=appointment.duration />
<@td class="bg-primary-subtle">
<@getCellTitle startingHour=appointment.startingHour startingMinute=appointment.startingMinute endingHour=appointment.endingHour endingMinute=appointment.endingMinute />
${appointment.appointmentDescription}
@td>
@tr>
#list>
<#assign maxTime = endingTime />
<#assign nbOccur = ( ( maxTime - currentTime ) / duration )?round />
<#if nbOccur > 0>
<#list 1..nbOccur as i>
<@addEmptyLine durationApp=duration/>
#list>
#if>
@tableBody>
@table>
@td>
#list>
@tr>
@table>
<#macro addEmptyLine durationApp>
<#assign saveCurrentHour = currentHour />
<#assign saveCurrentMinute = currentMinute />
<@updateCurrentTimeHourAndMinute durationApp=durationApp />
<@tr>
<#assign cellTitle><@getCellTitle startingHour=saveCurrentHour startingMinute=saveCurrentMinute endingHour=currentHour endingMinute=currentMinute />#assign>
<@td params='title="${cellTitle}"'> @td>
@tr>
#macro>
<#macro updateCurrentTimeHourAndMinute durationApp>
<#assign currentTime = currentTime + durationApp />
<#assign currentMinute = currentMinute + durationApp />
<#if currentMinute >= 60>
<#assign nbOccursPriv = (currentMinute / 60 )?floor />
<#list 1..nbOccursPriv as i>
<#assign currentHour = currentHour + 1 />
#list>
<#assign currentMinute = currentMinute % 60 />
#if>
#macro>
<#macro getCellTitle startingHour startingMinute endingHour endingMinute><#if startingHour < 10>0#if>${startingHour}h<#if startingMinute < 10>0#if>${startingMinute} - <#if endingHour < 10>0#if>${endingHour}h<#if endingMinute < 10>0#if>${endingMinute}#macro>