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

51 lines
1.9 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 "Color" "header" )}}</th>
<th scope="col">{{( pgettext "Name" "header" )}}</th>
<th scope="col">{{( pgettext "Translations" "campsite type" )}}</th>
<th scope="col">{{( pgettext "Active" "season" )}}</th>
</tr>
</thead>
<tbody>
{{ range .Seasons -}}
<tr>
<td>
<svg width="20px" height="20px">
<circle cx="50%" cy="50%" r="49%" fill="{{ .Color }}" stroke="#000" stroke-width=".5"/>
</svg>
</td>
<td><a href="{{ .URL }}">{{ .Name }}</a></td>
<td>
{{ range .Translations }}
<a
{{ if .Missing }}class="missing-translation"{{ end }}
href="{{ .URL }}">{{ .Endonym }}</a>
{{ end }}
</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>
{{ template "calendar.gohtml" .Calendar }}
{{- end }}