restructured viewmodels, better serialization

This commit is contained in:
Simon Martens
2024-11-19 15:20:15 +01:00
parent 84fa6f7fa4
commit 7dc603df2c
26 changed files with 51479 additions and 198 deletions

View File

@@ -1,19 +1,26 @@
{{ define "body" }}
{{ $y := .model.Year }}
{{ range $year := .model.AvailableYears }}
<a href="/{{ $year }}">{{ $year }}</a>
<a href="/{{ $year }}" aria-active="{{ eq $year $y }}">{{ $year }}</a>
{{ end }}
{{ range $issue := .model.Issues }}
<div>
<div>
{{ $issue.Number.Chardata }}
</div>
<div>
{{ index $issue.Month 1 }}
</div>
<div>
{{ index $issue.Weekday 1 }}
</div>
<div>{{ $issue.Day }}.{{ index $issue.Month 2 }}.</div>
</div>
{{ range $index, $month := .model.Issues }}
<!-- Month Header -->
{{ $first := index $month 0 }}
<h2>{{ index $first.Month 1 }}</h2>
<!-- Issues -->
{{ range $issue := $month }}
<a href="/{{ $y }}/{{ $issue.Number.Chardata }}">
<div>
{{ $issue.Number.Chardata }}
</div>
<div>
{{ index $issue.Weekday 1 }}
</div>
<div>{{ $issue.Day }}.{{ index $issue.Month 2 }}.</div>
</a>
{{ end }}
{{ end }}
{{ end }}