summaryrefslogtreecommitdiffhomepage
path: root/src/templates
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-09-21 10:09:58 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-09-21 10:09:58 +0200
commit4a1fe520e8aae6b220784ccfb34a6e7559e4cce7 (patch)
tree67ca0d2c601575d68c341c55c8b8897071870690 /src/templates
parent492f2df4e93fa151e7809203bca7b92379694665 (diff)
Implement /coins/mintages in Go templates
Diffstat (limited to 'src/templates')
-rw-r--r--src/templates/coins-mintages.html.tmpl143
1 files changed, 143 insertions, 0 deletions
diff --git a/src/templates/coins-mintages.html.tmpl b/src/templates/coins-mintages.html.tmpl
new file mode 100644
index 0000000..646203a
--- /dev/null
+++ b/src/templates/coins-mintages.html.tmpl
@@ -0,0 +1,143 @@
+{{ define "content" }}
+<header>
+ {{ template "navbar" . }}
+ <h1>{{ .T "Euro Coin Mintages" }}</h1>
+</header>
+<main>
+ <p>
+ {{ .T "Here you’ll be able to view all the known mintages for all coins. You’ll also be able to filter on country, denomination, etc. If you have any mintage data that’s missing from our site, feel free to contact us." }}
+ </p>
+ <hr />
+ {{ if eq .Code "nl" }}
+ <h2>{{ .T "Additional Notes" }}</h2>
+ <ul>
+ <li>
+ {{ .T "Most coins from the years 2003–2016 are listed as NIFC coins while other popular sources such as Numista claim they were minted for circulation. For more information on why others are wrong, %sclick here%s." `<a href="#TODO">` `</a>` }}
+ </li>
+ <li>
+ {{ .T "In 2003 Numista calculated a total of %d coins issued for coin sets per denomination. Our own calculations found only %d. Numista also forgot to include the many hundred thousand coins from the coin roll sets that were produced." 217503 177003 }}
+ </li>
+ </ul>
+ {{ end }}
+ <section>
+ <form>
+ <div class="grid">
+ <label for="country-dd">
+ {{ .T "Country" }}
+ <select id="country-dd" name="code">
+ {{ $code := .Code }}
+ {{ range .Countries }}
+ <option
+ value={{ .Code }}
+ {{ if eq .Code $code }}
+ selected
+ {{ end }}
+ >
+ {{ .Name }}
+ </option>
+ {{ end }}
+ </select>
+ </label>
+ <fieldset>
+ {{ template "coin-type-radio"
+ (tuple .Type "circ" (.T "Circulation Coins")) }}
+ {{ template "coin-type-radio"
+ (tuple .Type "nifc" (.T "NIFC / BU Sets")) }}
+ {{ template "coin-type-radio"
+ (tuple .Type "proof" (.T "Proof Coins")) }}
+ </fieldset>
+ </div>
+ <button type="submit">{{ .T "Filter" }}</button>
+ </form>
+ <figure>
+ <figcaption>{{ .T "Standard Issue Coins" }}</figcaption>
+ <table class="mintage-table" role="grid">
+ <thead>
+ <th>{{ .T "Year" }}</th>
+ {{ with $p := .Printer }}
+ {{ range denoms }}
+ <th>{{ $p.Money . false }}</th>
+ {{ end }}
+ {{ end }}
+ </thead>
+ <tbody>
+ {{ $p := .Printer }}
+ {{ $type := .Type }}
+ {{ range .Mintages.Standard }}
+ <tr>
+ <th scope="col">
+ {{- .Year -}}
+ {{- if ne .Mintmark "" -}}
+ &nbsp;<sub><small>{{ .Mintmark }}</small></sub>
+ {{- end -}}
+ </th>
+ {{ range (index .Mintages (strToCtype $type)) }}
+ {{ if eq . -1 }}
+ <td>{{ $p.T "Unknown" }}</td>
+ {{ else if eq . 0 }}
+ <td>—</td>
+ {{ else }}
+ <td>{{ $p.N . }}</td>
+ {{ end }}
+ </td>
+ {{ end }}
+ </tr>
+ {{ end }}
+ </tbody>
+ </table>
+ </figure>
+ {{ if ne (len .Mintages.Commemorative) 0 }}
+ <figure>
+ <figcaption>{{ .T "Commemorative Coins" }}</figcaption>
+ <table class="mintage-table-cc" role="grid">
+ <thead>
+ <th>{{ .T "Year" }}</th>
+ <th>{{ .T "Commemorated Issue" }}</th>
+ <th>{{ .T "Mintage" }}</th>
+ </thead>
+ <tbody>
+ {{ $p := .Printer }}
+ {{ $type := .Type }}
+ {{ range .Mintages.Commemorative }}
+ <tr>
+ <th scope="col">
+ {{- .Year -}}
+ {{- if ne .Mintmark "" -}}
+ &nbsp;<sub><small>{{ .Mintmark }}</small></sub>
+ {{- end -}}
+ </th>
+ <!-- TODO: Translate commemorative names -->
+ <td>{{ .Name }}</td>
+ {{ with (index .Mintage (strToCtype $type)) }}
+ {{ if eq . -1 }}
+ <td>{{ $p.T "Unknown" }}</td>
+ {{ else if eq . 0 }}
+ <td>—</td>
+ {{ else }}
+ <td>{{ $p.N . }}</td>
+ {{ end }}
+ {{ end }}
+ </tr>
+ {{ end }}
+ </tbody>
+ </table>
+ </figure>
+ {{ end }}
+ </section>
+</main>
+{{ end }}
+
+{{ define "coin-type-radio" }}
+<label for=compact-{{ index . 1 }}>
+ <input
+ id=compact-{{ index . 1 }}
+ name="type"
+ type="radio"
+ value={{ index . 1 }}
+ {{ if eq (index . 0) (index . 1) }}
+ checked
+ {{ end }}
+ />
+ {{ index . 2 }}
+</label>
+{{ end }}