camper/web/templates/admin/season/index.gohtml

40 lines
1.4 KiB
Plaintext
Raw Normal View History

<!--
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="50%" fill="{{ .Color }}"/>
</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 }}
{{- end }}