diff options
author | Thomas Voss <mail@thomasvoss.com> | 2025-06-06 01:32:41 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2025-06-06 01:32:41 +0200 |
commit | 2c726e551d90d20bcd2d78545c369864cc9038e5 (patch) | |
tree | 520615a33c966c729e70e549e859a2c01dc4ba40 /src/templates | |
parent | 9379ea42a9b0afd1abf705bf3300f03d8bbe79f9 (diff) |
Use CSV’s for mintages
Diffstat (limited to 'src/templates')
-rw-r--r-- | src/templates/coins-mintages.html.tmpl | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/templates/coins-mintages.html.tmpl b/src/templates/coins-mintages.html.tmpl index 8c60248..8554c3f 100644 --- a/src/templates/coins-mintages.html.tmpl +++ b/src/templates/coins-mintages.html.tmpl @@ -66,6 +66,7 @@ </div> <button type="submit">{{ .T "Filter" }}</button> </form> + {{ $data := (index .Mintages (strToCtype .Type)) }} <figure> <figcaption>{{ .T "Standard Issue Coins" }}</figcaption> <table class="mintage-table" role="grid"> @@ -80,7 +81,7 @@ <tbody> {{ $p := .Printer }} {{ $type := .Type }} - {{ range .Mintages.Standard }} + {{ range $data.Standard }} <tr> <th scope="col"> {{- .Year -}} @@ -88,9 +89,11 @@ <sub><small>{{ .Mintmark }}</small></sub> {{- end -}} </th> - {{ range (index .Mintages (strToCtype $type)) }} + {{ range .Mintages }} {{ if eq . -1 }} <td>{{ $p.T "Unknown" }}</td> + {{ else if eq . -2 }} + <td class="error">{{ $p.T "Error" }}</td> {{ else if eq . 0 }} <td>—</td> {{ else }} @@ -103,7 +106,7 @@ </tbody> </table> </figure> - {{ if ne (len .Mintages.Commemorative) 0 }} + {{ if ne (len $data.Commemorative) 0 }} <figure> <figcaption>{{ .T "Commemorative Coins" }}</figcaption> <table class="mintage-table-cc" role="grid"> @@ -115,7 +118,7 @@ <tbody> {{ $p := .Printer }} {{ $type := .Type }} - {{ range .Mintages.Commemorative }} + {{ range $data.Commemorative }} <tr> <th scope="col"> {{- .Year -}} @@ -125,9 +128,11 @@ </th> <!-- TODO: Translate commemorative names --> <td>{{ .Name }}</td> - {{ with (index .Mintage (strToCtype $type)) }} + {{ with .Mintage }} {{ if eq . -1 }} <td>{{ $p.T "Unknown" }}</td> + {{ else if eq . -2 }} + <td class="error">{{ $p.T "Error" }}</td> {{ else if eq . 0 }} <td>—</td> {{ else }} |