{{ $model := . }}


<nav class="print:hidden">
	{{- range $y := .years -}}
		<a
			class="inline-block stdlink px-0.5"
			href="/briefe?year={{ $y }}"
			{{ if eq $model.year $y -}}aria-current="page"{{- end }}
			>{{ $y }}</a
		>
	{{- end -}}
	<a
		class="inline-block stdlink px-0.5"
		href="/briefe?year=all"
		{{ if .all -}}aria-current="page"{{- end }}
		>Alle</a
	>
</nav>

{{- if .years -}}
	{{- if .year -}}
		{{- $letters := index $model.yearmap $model.year -}}
		<div class="flex flex-row gap-x-1">
			<div>Briefe für das Jahr {{- .year }}</div>
			<div>({{- len $letters }})</div>
		</div>
		{{ template "_letterlist" $letters -}}
	{{- end -}}

	{{- if .all -}}
		{{- range $y := .years -}}
			<div class="">
				{{- $y -}}
				{{- $letters := index $model.yearmap $y -}}
				<div>({{- len $letters }})</div>
				{{ template "_letterlist" $letters -}}
			</div>
		{{- end -}}
	{{- end -}}
{{- end -}}
