2023-10-14 21:14:23 +00:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: 2023 jordi fita mas <jordi@tandem.blog>
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
2023-10-18 19:06:41 +00:00
|
|
|
{{ $last := dec (len .Months)}}
|
|
|
|
{{ range $index, $month := .Months -}}
|
|
|
|
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/season.Month */ -}}
|
|
|
|
<table class="month"
|
|
|
|
{{ if eq $index $last -}}
|
|
|
|
data-hx-get="/{{ currentLocale }}/campsites/calendar?year={{ .Year }}&month={{ .Month | int }}"
|
|
|
|
data-hx-trigger="intersect once"
|
|
|
|
data-hx-swap="afterend"
|
|
|
|
{{- end }}
|
|
|
|
>
|
|
|
|
<caption>{{ pgettext .Name "month" }} {{ .Year }}</caption>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th scope="col">{{(pgettext "Mon" "day" )}}</th>
|
|
|
|
<th scope="col">{{(pgettext "Tue" "day" )}}</th>
|
|
|
|
<th scope="col">{{(pgettext "Wed" "day" )}}</th>
|
|
|
|
<th scope="col">{{(pgettext "Thu" "day" )}}</th>
|
|
|
|
<th scope="col">{{(pgettext "Fri" "day" )}}</th>
|
|
|
|
<th scope="col">{{(pgettext "Sat" "day" )}}</th>
|
|
|
|
<th scope="col">{{(pgettext "Sun" "day" )}}</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{{ range .Weeks }}
|
|
|
|
<tr>
|
|
|
|
{{- range . }}
|
|
|
|
<td>
|
|
|
|
{{- if .Color -}}
|
|
|
|
<time style="--red: {{ slice .Color 1 3 | hexToDec }}; --green: {{ slice .Color 3 5 | hexToDec }}; --blue: {{ slice .Color 5 7 | hexToDec }}"
|
|
|
|
datetime="{{ .Date.Format "2006-01-02" }}"
|
|
|
|
>{{ .Date.Format "2" }}</time>
|
|
|
|
{{- end -}}
|
|
|
|
</td>
|
2023-10-14 21:14:23 +00:00
|
|
|
{{- end }}
|
2023-10-18 19:06:41 +00:00
|
|
|
</tr>
|
2023-10-14 21:14:23 +00:00
|
|
|
{{- end }}
|
2023-10-18 19:06:41 +00:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
{{- end }}
|