summaryrefslogtreecommitdiffhomepage
path: root/template.old/coins_mintages.templ
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-09-21 11:49:47 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-09-21 11:49:47 +0200
commit8ece9e8a6de8e0dd1d5ee0318884e9a4e131b026 (patch)
tree41dafaee9597a1a5b61d49358f60354a1af99ef9 /template.old/coins_mintages.templ
parent141b94b694efa7663e113ccf4b3f08aea08a84f8 (diff)
Remove the template.old/ directory
Diffstat (limited to 'template.old/coins_mintages.templ')
-rw-r--r--template.old/coins_mintages.templ167
1 files changed, 0 insertions, 167 deletions
diff --git a/template.old/coins_mintages.templ b/template.old/coins_mintages.templ
deleted file mode 100644
index 894cb75..0000000
--- a/template.old/coins_mintages.templ
+++ /dev/null
@@ -1,167 +0,0 @@
-package template
-
-import (
- "strconv"
-
- "git.thomasvoss.com/euro-cash.eu/lib"
- "git.thomasvoss.com/euro-cash.eu/lib/mintage"
-)
-
-const muntrolpakketLinkStart = `<a href="#TODO">`
-
-var denoms = [...]float64{
- 0.01, 0.02, 0.05, 0.10,
- 0.20, 0.50, 1.00, 2.00,
-}
-
-templ CoinsMintages() {
- {{
- code := ctx.Value("code").(string)
- data := ctx.Value("mintages").(mintage.Data)
- ctype := ctx.Value("type").(string)
- p := ctx.Value("printer").(lib.Printer)
- }}
- <header>
- @navbar()
- <h1>{ p.T("Euro Coin Mintages") }</h1>
- </header>
- <main>
- <p>
- { 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 code == "nl" {
- <h2>{ p.T("Additional Notes") }</h2>
- <ul>
- <li>
- @templ.Raw(p.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.", muntrolpakketLinkStart, linkEnd))
- </li>
- <li>
- { p.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>
- }
- <section>
- <form>
- <div class="grid">
- <label for="country-dd">
- { p.T("Country") }
- <select id="country-dd" name="code">
- for _, c := range ctx.Value("countries").
- ([]lib.Country) {
- <option
- value={ c.Code }
- selected?={ c.Code == code }
- >
- { c.Name }
- </option>
- }
- </select>
- </label>
- <fieldset>
- @coinTypeRadio(ctype, "circ", p.T("Circulation Coins"))
- @coinTypeRadio(ctype, "nifc", p.T("NIFC / BU Sets"))
- @coinTypeRadio(ctype, "proof", p.T("Proof Coins"))
- </fieldset>
- </div>
- <button type="submit">{ p.T("Filter") }</button>
- </form>
- <figure>
- <figcaption>{ p.T("Standard Issue Coins") }</figcaption>
- <table class="mintage-table" role="grid">
- <thead>
- <th>{ p.T("Year") }</th>
- for _, x := range denoms {
- <th>{ p.Money(x, false) }</th>
- }
- </thead>
- <tbody>
- for _, row := range data.Standard {
- <tr>
- <th scope="col">
- if len(row.Mintmark) != 0 {
- { strconv.Itoa(row.Year) }&nbsp;<sub><small>{ row.Mintmark }</small></sub>
- } else {
- { strconv.Itoa(row.Year) }
- }
- </th>
- for _, col := range row.Mintages[strToCtype(ctype)] {
- switch col {
- case mintage.Unknown:
- <td>{ p.T("Unknown") }</td>
- case 0:
- <td>—</td>
- default:
- <td>{ p.N(col) }</td>
- }
- }
- </tr>
- }
- </tbody>
- </table>
- </figure>
- if len(data.Commemorative) != 0 {
- <figure>
- <figcaption>{ p.T("Commemorative Coins") }</figcaption>
- <table class="mintage-table-cc" role="grid">
- <thead>
- <th>{ p.T("Year") }</th>
- <th>{ p.T("Commemorated Issue") }</th>
- <th>{ p.T("Mintage") }</th>
- </thead>
- <tbody>
- for _, row := range data.Commemorative {
- <tr>
- <th scope="col">
- if len(row.Mintmark) != 0 {
- { strconv.Itoa(row.Year) }&nbsp;<sub><small>{ row.Mintmark }</small></sub>
- } else {
- { strconv.Itoa(row.Year) }
- }
- </th>
- <!-- TODO: Translate commemorative names! -->
- <td>{ row.Name }</td>
- switch row.Mintage[strToCtype(ctype)] {
- case mintage.Unknown:
- <td>{ p.T("Unknown") }</td>
- case 0:
- <td>—</td>
- default:
- <td>{ p.N(row.Mintage[strToCtype(ctype)]) }</td>
- }
- </tr>
- }
- </tbody>
- </table>
- </figure>
- }
- </section>
- </main>
-}
-
-templ coinTypeRadio(ctype, short, long string) {
- <label for={ "compact-" + short }>
- <input
- id={ "compact-" + short }
- type="radio"
- name="type"
- value={ short }
- checked?={ ctype == short }
- />
- { long }
- </label>
-}
-
-func strToCtype(s string) int {
- switch s {
- case "circ":
- return mintage.TypeCirc
- case "nifc":
- return mintage.TypeNIFC
- case "proof":
- return mintage.TypeProof
- }
-
- /* Should never happen, but just incase */
- return mintage.TypeCirc
-}