Templates angepasst

This commit is contained in:
Simon Martens
2024-12-23 22:11:35 +01:00
parent d8892941a6
commit 4de0eab443
4 changed files with 10 additions and 10 deletions

View File

@@ -51,7 +51,7 @@ func (i Issue) Year() int {
}
func (i Issue) Reference() string {
return strconv.Itoa(i.Number.No) + "-" + i.Datum.When.String()
return strconv.Itoa(i.Number.No) + "-" + strconv.Itoa(i.Datum.When.Year)
}
func (i Issue) String() string {

View File

@@ -29,7 +29,7 @@ type IssueVM struct {
}
func NewSingleIssueView(y string, no string, lib *xmlprovider.Library) (*IssueVM, error) {
issue := lib.Issues.Item(y + "-" + no)
issue := lib.Issues.Item(no + "-" + y)
if issue == nil {
return nil, fmt.Errorf("No issue found for %v-%v", y, no)
}

View File

@@ -1,17 +1,17 @@
{{ $model := .model }}
{{ $date := GetDate .model.Datum.When }}
{{ $date := .model.Datum.When }}
<div>
<a href="/{{- $model.Year -}}">
<a href="/{{- $date.Year -}}">
Zurück zum Jahr
{{ $model.Year }}
{{ $date.Year }}
</a>
</div>
<div>
<div class="py-3 text-xl">
<div>{{ $model.Year }}</div>
<div>{{ $date.Year }}</div>
<div>Stück {{ $model.No }}</div>
<div>{{ $model.Day }}. {{ $date.Month }} ({{ $date.Weekday }})</div>
<div>{{ WeekdayName $date.Weekday }}, {{ $date.Day }}. {{ MonthName $date.Month }}</div>
</div>
{{ template "_inhaltsverzeichnis" . }}
</div>

View File

@@ -20,11 +20,11 @@
{{ range $issue := $piece.IssueRefs }}
<li>
<a
href="/{{- $issue.Datum -}}/{{- $issue.Nr -}}"
{{ if and (eq $issue.Nr $model.No) (eq $issue.Datum $model.Year) }}
href="/{{- $issue.When -}}/{{- $issue.Nr -}}"
{{ if and (eq $issue.Nr $model.No) (eq $issue.When.Year $model.Datum.When.Year) }}
aria-current="page"
{{ end }}>
{{- $issue.Datum }} Nr.
{{- $issue.When.Year }} Nr.
{{ $issue.Nr -}}
</a>
</li>