75 lines
2.8 KiB
Plaintext
75 lines
2.8 KiB
Plaintext
<!--
|
|
SPDX-FileCopyrightText: 2023 jordi fita mas <jordi@tandem.blog>
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
-->
|
|
{{ define "title" -}}
|
|
{{( pgettext "Seasons" "title" )}}
|
|
{{- end }}
|
|
|
|
{{ define "content" -}}
|
|
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/season.seasonIndex*/ -}}
|
|
<a href="/admin/seasons/new">{{( pgettext "Add Season" "action" )}}</a>
|
|
<h2>{{( pgettext "Seasons" "title" )}}</h2>
|
|
{{ if .Seasons -}}
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th scope="col">{{( pgettext "Name" "header" )}}</th>
|
|
<th scope="col">{{( pgettext "Color" "header" )}}</th>
|
|
<th scope="col">{{( pgettext "Active" "season" )}}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{ range .Seasons -}}
|
|
<tr>
|
|
<td><a href="/admin/seasons/{{ .Slug }}">{{ .Name }}</a></td>
|
|
<td>
|
|
<svg width="20px" height="20px">
|
|
<circle cx="50%" cy="50%" r="49%" fill="{{ .Color }}" stroke="#000" stroke-width=".5"/>
|
|
</svg>
|
|
</td>
|
|
<td>{{ if .Active }}{{( gettext "Yes" )}}{{ else }}{{( gettext "No" )}}{{ end }}</td>
|
|
</tr>
|
|
{{- end }}
|
|
</tbody>
|
|
</table>
|
|
{{ else -}}
|
|
<p>{{( gettext "No seasons added yet." )}}</p>
|
|
{{- end }}
|
|
|
|
<h2>{{( pgettext "Calendar" "title" )}}</h2>
|
|
<div class="season-calendar">
|
|
{{ range .Calendar -}}
|
|
<table>
|
|
<caption>{{ pgettext .Name "month" }}</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 -}}
|
|
<svg viewBox="0 0 100 100">
|
|
<rect x="0" y="0" width="100" height="100" fill="{{ .Color }}"/>
|
|
</svg>
|
|
{{- end -}}
|
|
</td>
|
|
{{- end }}
|
|
</tr>
|
|
{{- end }}
|
|
</tbody>
|
|
</table>
|
|
{{- end }}
|
|
</div>
|
|
{{- end }}
|