{{template "admin" .}} {{define "page-title"}} Reservations Calendar {{end}} {{define "content"}} {{$now := index .Data "now"}} {{$rooms := index .Data "rooms"}} {{$dim := index .IntMap "days_in_month"}} {{$curMonth := index .StringMap "this_month"}} {{$curYear := index .StringMap "this_month_year"}}

{{formatDate $now "January"}} {{formatDate $now "2006"}}

<<
>>
{{range $rooms}} {{$roomID := .ID}} {{$blocks := index $.Data (printf "block_map_%d" .ID)}} {{$reservations := index $.Data (printf "reservation_map_%d" .ID)}}

{{.RoomName}}

{{range $index := iterate $dim}} {{end}} {{range $index := iterate $dim}} {{end}}
{{add $index 1}}
{{if gt (index $reservations (printf "%s-%s-%d" $curYear $curMonth (add $index 1))) 0}} R {{else}} {{end}}
{{end}}
{{end}}