From 46a4e630a46fd7a57631cfb08bc01da250814336 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Thu, 7 Aug 2025 13:35:49 +0200 Subject: Simplify mintages code --- src/templates/coins-mintages.html.tmpl | 52 +++++++++++++++++----------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'src/templates/coins-mintages.html.tmpl') diff --git a/src/templates/coins-mintages.html.tmpl b/src/templates/coins-mintages.html.tmpl index 7c041f3..6a8a744 100644 --- a/src/templates/coins-mintages.html.tmpl +++ b/src/templates/coins-mintages.html.tmpl @@ -99,11 +99,12 @@ + + {{ if and (eq .FilterBy "country") + (gt (len .CountryMintages.Standard) 0) }}
{{ .Get "Standard Issue Coins" }}
- {{ if eq .FilterBy "country" }} - @@ -122,8 +123,8 @@ {{ range .Mintages }} @@ -133,9 +134,15 @@ {{ end }}
{{ .GetC "Year" "Header/Label" }}
{{- .Year -}} - {{- if ne .Mintmark "" -}} -  {{ .Mintmark }} + {{- if .Mintmark.Valid -}} +  {{ .Mintmark.V }} {{- end -}}
+
+
- {{ else if eq .FilterBy "year" }} + {{ else if and (eq .FilterBy "year") + (gt (len .YearMintages.Standard) 0) }} +
+
{{ .Get "Standard Issue Coins" }}
+
@@ -154,8 +161,8 @@ {{ range .Mintages }} @@ -165,9 +172,9 @@ {{ end }}
{{ .GetC "Country" "Header/Label" }}
{{- .Country -}} - {{- if ne .Mintmark "" -}} -  {{ .Mintmark }} + {{- if .Mintmark.Valid -}} +  {{ .Mintmark.V }} {{- end -}}
- {{ end }}
+ {{ end }} {{ if eq .FilterBy "country" }} {{ if ne (len .CountryMintages.Commemorative) 0 }} @@ -185,15 +192,12 @@ {{- .Year -}} - {{- if ne .Mintmark "" -}} -  {{ .Mintmark }} + {{- if .Mintmark.Valid -}} +  {{ .Mintmark.V }} {{- end -}} - - {{ .Name }} - {{ with .Mintage }} - {{ template "mintages/mintage-cell" (tuple . $p) }} - {{ end }} + {{ $p.GetC .Name "CC Name" }} + {{ template "mintages/mintage-cell" (tuple .Mintage $p) }} {{ end }} @@ -218,15 +222,13 @@ {{- .Country -}} - {{- if ne .Mintmark "" -}} -  {{ .Mintmark }} + {{- if .Mintmark.Valid -}} +  {{ .Mintmark.V }} {{- end -}} {{ .Name }} - {{ with .Mintage }} - {{ template "mintages/mintage-cell" (tuple . $p) }} - {{ end }} + {{ template "mintages/mintage-cell" (tuple .Mintage $p) }} {{ end }} @@ -271,13 +273,11 @@ {{ define "mintages/mintage-cell" }} {{ $v := index . 0 }} {{ $p := index . 1 }} -{{ if eq $v -1 }} +{{ if not $v.Valid }} {{ $p.Get "Unknown" }} -{{ else if eq $v -2 }} - {{ $p.Get "Error" }} -{{ else if eq $v 0 }} +{{ else if eq $v.V 0 }} — {{ else }} - {{ $p.Itoa $v }} -{{ end }} + {{ $p.Itoa $v.V }} {{ end }} +{{ end }} \ No newline at end of file -- cgit v1.2.3