diff options
author | Thomas Voss <mail@thomasvoss.com> | 2025-08-04 01:23:32 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2025-08-04 01:23:32 +0200 |
commit | d838cee9cb536049119a22e805746d958628387d (patch) | |
tree | 44dfe9c5c27b1993401e3b81e6d14e24e224a7ae /src | |
parent | 4230f1c26beed64d84e9a14c0bb0a6cf4c5bfc8a (diff) |
Big changes to everything
Diffstat (limited to 'src')
-rw-r--r-- | src/countries.go | 29 | ||||
-rw-r--r-- | src/dbx/mintages.go | 135 | ||||
-rw-r--r-- | src/http.go | 63 | ||||
-rw-r--r-- | src/templates.go | 45 | ||||
-rw-r--r-- | src/templates/-404.html.tmpl | 4 | ||||
-rw-r--r-- | src/templates/-base.html.tmpl | 4 | ||||
-rw-r--r-- | src/templates/-navbar.html.tmpl | 19 | ||||
-rw-r--r-- | src/templates/banknotes-codes.html.tmpl | 535 | ||||
-rw-r--r-- | src/templates/banknotes.html.tmpl | 74 | ||||
-rw-r--r-- | src/templates/coins-mintages.html.tmpl | 310 | ||||
-rw-r--r-- | src/templates/coins.html.tmpl | 74 | ||||
-rw-r--r-- | src/templates/collecting-crh.html.tmpl | 590 | ||||
-rw-r--r-- | src/templates/collecting.html.tmpl | 96 | ||||
-rw-r--r-- | src/templates/index.html.tmpl | 4 | ||||
-rw-r--r-- | src/templates/jargon.html.tmpl | 11 | ||||
-rw-r--r-- | src/templates/language.html.tmpl | 6 |
16 files changed, 1247 insertions, 752 deletions
diff --git a/src/countries.go b/src/countries.go index 657cac8..d168266 100644 --- a/src/countries.go +++ b/src/countries.go @@ -13,6 +13,35 @@ type country struct { Code, Name string } +var countryCodeToName = map[string]string{ + "ad": "Andorra", + "at": "Austria", + "be": "Belgium", + /* TODO(2026): Add Bulgaria */ + /* "bg": "Bulgaria", */ + "cy": "Cyprus", + "de": "Germany", + "ee": "Estonia", + "es": "Spain", + "fi": "Finland", + "fr": "France", + "gr": "Greece", + "hr": "Croatia", + "ie": "Ireland", + "it": "Italy", + "lt": "Lithuania", + "lu": "Luxembourg", + "lv": "Latvia", + "mc": "Monaco", + "mt": "Malta", + "nl": "Netherlands", + "pt": "Portugal", + "si": "Slovenia", + "sk": "Slovakia", + "sm": "San Marino", + "va": "Vatican City", +} + func sortedCountries(p i18n.Printer) []country { xs := []country{ {Code: "ad", Name: p.GetC("Andorra", "Place Name")}, diff --git a/src/dbx/mintages.go b/src/dbx/mintages.go index 5b226bd..9b98bd6 100644 --- a/src/dbx/mintages.go +++ b/src/dbx/mintages.go @@ -5,9 +5,14 @@ import ( "slices" ) -type MintageData struct { - Standard []MSRow - Commemorative []MCRow +type CountryMintageData struct { + Standard []MSCountryRow + Commemorative []MCCountryRow +} + +type YearMintageData struct { + Standard []MSYearRow + Commemorative []MCYearRow } type msRowInternal struct { @@ -31,14 +36,14 @@ type mcRowInternal struct { Reference sql.Null[string] } -type MSRow struct { +type MSCountryRow struct { Year int Mintmark string Mintages [ndenoms]int References []string } -type MCRow struct { +type MCCountryRow struct { Year int Name string Number int @@ -47,6 +52,22 @@ type MCRow struct { Reference string } +type MSYearRow struct { + Country string + Mintmark string + Mintages [ndenoms]int + References []string +} + +type MCYearRow struct { + Country string + Name string + Number int + Mintmark string + Mintage int + Reference string +} + type MintageType int /* DO NOT REORDER! */ @@ -78,11 +99,101 @@ func NewMintageType(s string) MintageType { return TypeCirc } -func GetMintages(country string, typ MintageType) (MintageData, error) { +func GetMintagesByYear(year int, typ MintageType) (YearMintageData, error) { + var ( + zero YearMintageData + xs []MSYearRow + ys []MCYearRow + ) + + rs, err := db.Queryx(` + SELECT * FROM mintages_s + WHERE year = ? AND type = ? + ORDER BY country, mintmark, denomination + `, year, typ) + if err != nil { + return zero, err + } + + for rs.Next() { + var x msRowInternal + if err = rs.StructScan(&x); err != nil { + return zero, err + } + + loop: + msr := MSYearRow{ + Country: x.Country, + Mintmark: sqlOr(x.Mintmark, ""), + References: make([]string, 0, ndenoms), + } + for i := range msr.Mintages { + msr.Mintages[i] = MintageUnknown + } + msr.Mintages[denomToIdx(x.Denomination)] = + sqlOr(x.Mintage, MintageUnknown) + if x.Reference.Valid { + msr.References = append(msr.References, x.Reference.V) + } + + for rs.Next() { + var y msRowInternal + if err = rs.StructScan(&y); err != nil { + return zero, err + } + + if x.Country != y.Country || x.Mintmark != y.Mintmark { + x = y + xs = append(xs, msr) + goto loop + } + + msr.Mintages[denomToIdx(y.Denomination)] = + sqlOr(y.Mintage, MintageUnknown) + if y.Reference.Valid { + msr.References = append(msr.References, y.Reference.V) + } + } + + xs = append(xs, msr) + } + + if err = rs.Err(); err != nil { + return zero, err + } + + rs, err = db.Queryx(` + SELECT * FROM mintages_c + WHERE year = ? AND type = ? + ORDER BY country, mintmark, number + `, year, typ) + if err != nil { + return zero, err + } + + for rs.Next() { + var y mcRowInternal + if err = rs.StructScan(&y); err != nil { + return zero, err + } + ys = append(ys, MCYearRow{ + Country: y.Country, + Name: y.Name, + Number: y.Number, + Mintmark: sqlOr(y.Mintmark, ""), + Mintage: sqlOr(y.Mintage, MintageUnknown), + Reference: sqlOr(y.Reference, ""), + }) + } + + return YearMintageData{xs, ys}, nil +} + +func GetMintagesByCountry(country string, typ MintageType) (CountryMintageData, error) { var ( - zero MintageData - xs []MSRow - ys []MCRow + zero CountryMintageData + xs []MSCountryRow + ys []MCCountryRow ) rs, err := db.Queryx(` @@ -101,7 +212,7 @@ func GetMintages(country string, typ MintageType) (MintageData, error) { } loop: - msr := MSRow{ + msr := MSCountryRow{ Year: x.Year, Mintmark: sqlOr(x.Mintmark, ""), References: make([]string, 0, ndenoms), @@ -155,7 +266,7 @@ func GetMintages(country string, typ MintageType) (MintageData, error) { if err = rs.StructScan(&y); err != nil { return zero, err } - ys = append(ys, MCRow{ + ys = append(ys, MCCountryRow{ Year: y.Year, Name: y.Name, Number: y.Number, @@ -165,7 +276,7 @@ func GetMintages(country string, typ MintageType) (MintageData, error) { }) } - return MintageData{xs, ys}, rs.Err() + return CountryMintageData{xs, ys}, rs.Err() } func sqlOr[T any](v sql.Null[T], dflt T) T { diff --git a/src/http.go b/src/http.go index ac6f6da..071b25c 100644 --- a/src/http.go +++ b/src/http.go @@ -13,6 +13,8 @@ import ( "strings" "time" + "golang.org/x/text/collate" + "golang.org/x/text/language" . "git.thomasvoss.com/euro-cash.eu/pkg/try" "git.thomasvoss.com/euro-cash.eu/src/dbx" @@ -38,6 +40,7 @@ func Run(port int) { mux.Handle("GET /storage/", fs) if Debugp { mux.Handle("GET /style.css", fs) + mux.Handle("GET /style-2.css", fs) } else { mux.Handle("GET /style.min.css", fs) } @@ -137,12 +140,6 @@ func countryHandler(next http.Handler) http.Handler { func mintageHandler(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { td := r.Context().Value("td").(*templateData) - td.Code = r.FormValue("code") - if !slices.ContainsFunc(td.Countries, func(c country) bool { - return c.Code == td.Code - }) { - td.Code = td.Countries[0].Code - } td.Type = r.FormValue("type") switch td.Type { @@ -151,8 +148,60 @@ func mintageHandler(next http.Handler) http.Handler { td.Type = "circ" } + td.FilterBy = r.FormValue("filter-by") + switch td.FilterBy { + case "country", "year": + default: + td.FilterBy = "country" + } + var err error - td.Mintages, err = dbx.GetMintages(td.Code, dbx.NewMintageType(td.Type)) + mt := dbx.NewMintageType(td.Type) + + switch td.FilterBy { + case "country": + td.Code = r.FormValue("country") + if !slices.ContainsFunc(td.Countries, func(c country) bool { + return c.Code == td.Code + }) { + td.Code = td.Countries[0].Code + } + td.CountryMintages, err = dbx.GetMintagesByCountry(td.Code, mt) + case "year": + td.Year, err = strconv.Atoi(r.FormValue("year")) + if err != nil { + td.Year = 1999 + } + td.YearMintages, err = dbx.GetMintagesByYear(td.Year, mt) + + /* NOTE: It’s safe to use MustParse() here, because by this + point we know that all BCPs are valid. */ + c := collate.New(language.MustParse(td.Printer.Bcp)) + for i, r := range td.YearMintages.Standard { + name := td.Printer.GetC( + countryCodeToName[r.Country], "Place Name") + td.YearMintages.Standard[i].Country = name + } + for i, r := range td.YearMintages.Commemorative { + name := td.Printer.GetC( + countryCodeToName[r.Country], "Place Name") + td.YearMintages.Commemorative[i].Country = name + } + slices.SortFunc(td.YearMintages.Standard, func(x, y dbx.MSYearRow) int { + Δ := c.CompareString(x.Country, y.Country) + if Δ == 0 { + Δ = c.CompareString(x.Mintmark, y.Mintmark) + } + return Δ + }) + slices.SortFunc(td.YearMintages.Commemorative, func(x, y dbx.MCYearRow) int { + Δ := c.CompareString(x.Country, y.Country) + if Δ == 0 { + Δ = c.CompareString(x.Mintmark, y.Mintmark) + } + return Δ + }) + } if err != nil { throwError(http.StatusInternalServerError, err, w, r) return diff --git a/src/templates.go b/src/templates.go index 3852b9d..076f8dc 100644 --- a/src/templates.go +++ b/src/templates.go @@ -5,6 +5,7 @@ import ( "io/fs" "log" "strings" + "time" . "git.thomasvoss.com/euro-cash.eu/pkg/try" "git.thomasvoss.com/euro-cash.eu/pkg/watch" @@ -14,12 +15,14 @@ import ( ) type templateData struct { - Debugp bool - Printer i18n.Printer - Printers map[string]i18n.Printer - Code, Type string - Mintages dbx.MintageData - Countries []country + Debugp bool + Printer i18n.Printer + Printers map[string]i18n.Printer + Code, Type, FilterBy string + Year int + CountryMintages dbx.CountryMintageData + YearMintages dbx.YearMintageData + Countries []country } var ( @@ -30,16 +33,22 @@ var ( "ifElse": ifElse, "locales": i18n.Locales, "map": templateMakeMap, + "plus1": plus1, "safe": asHTML, "toString": toString, "toUpper": strings.ToUpper, "tuple": templateMakeTuple, "withTranslation": withTranslation, "withTranslations": withTranslations, + "years": years, } ) func BuildTemplates(dir fs.FS) { + buildTemplates(dir, Debugp) +} + +func buildTemplates(dir fs.FS, debugp bool) { ents := Try2(fs.ReadDir(dir, ".")) notFoundTmpl = buildTemplate(dir, "-404") errorTmpl = buildTemplate(dir, "-error") @@ -51,7 +60,7 @@ func BuildTemplates(dir fs.FS) { } name := e.Name() buildAndSetTemplate(dir, name) - if Debugp { + if debugp { go watch.FileFS(dir, name, func() { defer func() { if p := recover(); p != nil { @@ -59,8 +68,13 @@ func BuildTemplates(dir fs.FS) { } }() - buildAndSetTemplate(dir, name) - log.Printf("Template ‘%s’ updated\n", name) + if strings.HasPrefix(name, "-") { + buildTemplates(dir, false) + log.Println("All templates updated") + } else { + buildAndSetTemplate(dir, name) + log.Printf("Template ‘%s’ updated\n", name) + } }) } } @@ -185,6 +199,19 @@ func withTranslations(tag string, text string, translations ...[]any) template.H return template.HTML(bob.String()) } +func plus1(x int) int { + return x + 1 +} + +func years() []int { + sy, ey := 1999, time.Now().Year() + xs := make([]int, ey-sy+1) + for i := range xs { + xs[i] = sy + i + } + return xs +} + func (td templateData) Get(fmt string, args ...map[string]any) template.HTML { return template.HTML(td.Printer.Get(fmt, args...)) } diff --git a/src/templates/-404.html.tmpl b/src/templates/-404.html.tmpl index b149777..fd17cf6 100644 --- a/src/templates/-404.html.tmpl +++ b/src/templates/-404.html.tmpl @@ -3,11 +3,11 @@ {{ end }} {{ define "content" }} -<header> +<header class="container"> {{ template "navbar" . }} <h1>{{ .Get "Page Not Found" }}</h1> </header> -<main> +<main class="container"> <p> {{ .Get "The page you were looking for does not exist. If you believe this is a mistake then don’t hesitate to contact ‘@onetruemangoman’ on Discord or email us at {Email:e}." (map "Email" "mail@euro-cash.eu") }} diff --git a/src/templates/-base.html.tmpl b/src/templates/-base.html.tmpl index 62f3301..f455a14 100644 --- a/src/templates/-base.html.tmpl +++ b/src/templates/-base.html.tmpl @@ -4,7 +4,7 @@ <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> {{ if .Debugp }} - <link href="/style.css" type="text/css" rel="stylesheet"> + <link href="/style-2.css" type="text/css" rel="stylesheet"> {{ else }} <link href="/style.min.css" type="text/css" rel="stylesheet"> {{ end }} @@ -38,7 +38,7 @@ </head> <body> {{ template "content" . }} - <footer> + <footer class="container"> <p> <small> {{ .Get "Found a mistake or want to contribute missing information?" }} diff --git a/src/templates/-navbar.html.tmpl b/src/templates/-navbar.html.tmpl index 33484b8..588f554 100644 --- a/src/templates/-navbar.html.tmpl +++ b/src/templates/-navbar.html.tmpl @@ -8,7 +8,7 @@ } svg { - stroke: var(--color); + stroke: var(--pico-color); height: 1rem; } } @@ -24,31 +24,30 @@ } svg { - --size: 1.2rem; - stroke: var(--primary); + stroke: var(--pico-primary); stroke-width: .1; - height: var(--size); - width: var(--size); + height: 1.2rem; + width: 2rem; } } [data-theme="light"] #nav-icon-theme svg { - fill: var(--primary); + fill: var(--pico-primary); } </style> {{ end }} {{ define "navbar" }} <nav> - <menu> + <ul> <li><a href="/">{{ .Get "Home" }}</a></li> <li><a href="#TODO">{{ .Get "News" }}</a></li> <li><a href="/collecting">{{ .Get "Coin Collecting" }}</a></li> <li><a href="/coins">{{ .Get "Coins" }}</a></li> <li><a href="/banknotes">{{ .Get "Banknotes" }}</a></li> <li><a href="/jargon">{{ .Get "Jargon" }}</a></li> - </menu> - <menu> + </ul> + <ul> <li> <a href="https://discord.gg/DCaXfRcy9C" target="_blank"> {{ .Get "Discord" }} @@ -263,6 +262,6 @@ </svg> </button> </li> - </menu> + </ul> </nav> {{ end }}
\ No newline at end of file diff --git a/src/templates/banknotes-codes.html.tmpl b/src/templates/banknotes-codes.html.tmpl index ef926a1..8c2adcf 100644 --- a/src/templates/banknotes-codes.html.tmpl +++ b/src/templates/banknotes-codes.html.tmpl @@ -1,47 +1,85 @@ {{ define "header" }} {{ template "header-navbar" . }} + +<style> + .design-container { + --euro-cash-design-width: 90%; + } + + table { + white-space: nowrap; + + tr :is(th, td):first-child { + text-align: center; + } + } + + #seperated-tables { + display: none; + } + + @media (min-width: 576px) { + #seperated-tables { + display: flex; + justify-content: space-between; + gap: var(--pico-grid-column-gap); + } + + #joint-table { + display: none; + } + } +</style> {{ end }} {{ define "content" }} -<header> +<header class="container"> {{ template "navbar" . }} <h1>{{ .Get "Location Codes" }}</h1> </header> -<main> +<main class="container"> <p> {{ .Get "Euro banknotes have two codes on them: a printer code and a serial number. The printer code tells you where a given note was printed, while the serial number tells you which country issued the banknote (for the 2002 series) or where the banknote was printed (for the Europa series)." }} </p> - <h2>{{ .Get "Printer Code" }}</h2> + <h2>{{ .Get "Printer Codes" }}</h2> <p> {{ .Get "The printer code (not to be confused with the serial number) is a small code printed on banknotes with information about where the banknote was printed. All printer codes have the form ‘X000X0’ — or in other words — a letter followed by 3 numbers, a letter and a final number." }} </p> <p> {{ .Get "The printer code can be a bit tricky to find. The following dropdown menus will show you where to find the printer code on each note." }} </p> - <details> - <summary>{{ .Get "2002 Series Printer Codes" }}</summary> - <p> - {{ .Get "All these images are taken from {Link:L}eurobilltracker.com{-:E}." - (map "Link" "https://eurobilltracker.com") }} - </p> - {{ template "banknotes/codes/code-pos" (tuple .Printer 5 "2002") }} - {{ template "banknotes/codes/code-pos" (tuple .Printer 10 "2002") }} - {{ template "banknotes/codes/code-pos" (tuple .Printer 20 "2002") }} - {{ template "banknotes/codes/code-pos" (tuple .Printer 50 "2002") }} - {{ template "banknotes/codes/code-pos" (tuple .Printer 100 "2002") }} - {{ template "banknotes/codes/code-pos" (tuple .Printer 200 "2002") }} - {{ template "banknotes/codes/code-pos" (tuple .Printer 500 "2002") }} - </details> - <details> - <summary>{{ .Get "Europa Series Printer Codes" }}</summary> - {{ template "banknotes/codes/code-pos" (tuple .Printer 5 "europa") }} - {{ template "banknotes/codes/code-pos" (tuple .Printer 10 "europa") }} - {{ template "banknotes/codes/code-pos" (tuple .Printer 20 "europa") }} - {{ template "banknotes/codes/code-pos" (tuple .Printer 50 "europa") }} - {{ template "banknotes/codes/code-pos" (tuple .Printer 100 "europa") }} - {{ template "banknotes/codes/code-pos" (tuple .Printer 200 "europa") }} - </details> + + <article> + <details name="printer-codes"> + <summary>{{ .Get "2002 Series Printer Codes" }}</summary><hr> + <p> + {{ .Get "All these images are taken from {Link:L}eurobilltracker.com{-:E}." + (map "Link" "https://eurobilltracker.com") }} + </p> + <article> + {{ template "banknotes/codes/code-pos" (tuple .Printer 5 "2002") }}<hr> + {{ template "banknotes/codes/code-pos" (tuple .Printer 10 "2002") }}<hr> + {{ template "banknotes/codes/code-pos" (tuple .Printer 20 "2002") }}<hr> + {{ template "banknotes/codes/code-pos" (tuple .Printer 50 "2002") }}<hr> + {{ template "banknotes/codes/code-pos" (tuple .Printer 100 "2002") }}<hr> + {{ template "banknotes/codes/code-pos" (tuple .Printer 200 "2002") }}<hr> + {{ template "banknotes/codes/code-pos" (tuple .Printer 500 "2002") }} + </article> + </details> + <hr> + <details name="printer-codes"> + <summary>{{ .Get "Europa Series Printer Codes" }}</summary><hr> + <article> + {{ template "banknotes/codes/code-pos" (tuple .Printer 5 "europa") }}<hr> + {{ template "banknotes/codes/code-pos" (tuple .Printer 10 "europa") }}<hr> + {{ template "banknotes/codes/code-pos" (tuple .Printer 20 "europa") }}<hr> + {{ template "banknotes/codes/code-pos" (tuple .Printer 50 "europa") }}<hr> + {{ template "banknotes/codes/code-pos" (tuple .Printer 100 "europa") }}<hr> + {{ template "banknotes/codes/code-pos" (tuple .Printer 200 "europa") }} + </article> + </details> + </article> <p> {{ .Get "The first letter in the printer code identifies the specific printer at which the banknote was printed. The tables below will tell you which letters correspond to which printers. The final letter and number form a pair (such as ‘A2’ or ‘D6’) — this pair acts as a set of coordinates telling you where on the sheet of paper the banknote was located. During printing, banknotes are printed in a grid on a large sheet of paper which is then cut into individual banknotes. A note with the pair ‘A1’ will have been at the upper-left corner of the printing sheet, with ‘A2’ to its right and ‘B1’ below it." }} @@ -52,11 +90,99 @@ {{ .Get "In the 2002 series, the first letter of the serial number can be used to identify the country that issued the banknote. The following table shows which countries map to which codes." }} </p> - <table role="grid"> + <div id="seperated-tables"> + <table class="striped"> + <thead> + <tr> + <th>{{ .GetC "Code" "Header/Label" }}</th> + <th>{{ .GetC "Country" "Header/Label" }}</th> + </tr> + </thead> + <tbody> + <tr> + <td>D</td> + <td>{{ .GetC "Estonia" "Place Name" }}</td> + </tr> + <tr> + <td>E</td> + <td>{{ .GetC "Slovakia" "Place Name" }}</td> + </tr> + <tr> + <td>F</td> + <td>{{ .GetC "Malta" "Place Name" }}</td> + </tr> + <tr> + <td>G</td> + <td>{{ .GetC "Cyprus" "Place Name" }}</td> + </tr> + <tr> + <td>H</td> + <td>{{ .GetC "Slovenia" "Place Name" }}</td> + </tr> + <tr> + <td>L</td> + <td>{{ .GetC "Finland" "Place Name" }}</td> + </tr> + <tr> + <td>M</td> + <td>{{ .GetC "Portugal" "Place Name" }}</td> + </tr> + <tr> + <td>N</td> + <td>{{ .GetC "Austria" "Place Name" }}</td> + </tr> + </tbody> + </table> + + <table class="striped"> + <thead> + <tr> + <th>{{ .GetC "Code" "Header/Label" }}</th> + <th>{{ .GetC "Country" "Header/Label" }}</th> + </tr> + </thead> + <tbody> + <tr> + <td>P</td> + <td>{{ .GetC "Netherlands" "Place Name" }}</td> + </tr> + <tr> + <td>S</td> + <td>{{ .GetC "Italy" "Place Name" }}</td> + </tr> + <tr> + <td>T</td> + <td>{{ .GetC "Ireland" "Place Name" }}</td> + </tr> + <tr> + <td>U</td> + <td>{{ .GetC "France" "Place Name" }}</td> + </tr> + <tr> + <td>V</td> + <td>{{ .GetC "Spain" "Place Name" }}</td> + </tr> + <tr> + <td>X</td> + <td>{{ .GetC "Germany" "Place Name" }}</td> + </tr> + <tr> + <td>Y</td> + <td>{{ .GetC "Greece" "Place Name" }}</td> + </tr> + <tr> + <td>Z</td> + <td>{{ .GetC "Belgium" "Place Name" }}</td> + </tr> + </tbody> + </table> + </div> + + <table id="joint-table" class="striped"> <thead> <tr> - <th>{{ .Get "Code" }}</th> - <th>{{ .Get "Country" }}</th> + <th>{{ .GetC "Code" "Header/Label" }}</th> + <th>{{ .GetC "Country" "Header/Label" }}</th> </tr> </thead> <tbody> @@ -131,22 +257,146 @@ {{ .Get "The first letter of the printer code can be used to identify the specific printer at which the banknote was printed. The printer and country codes do not need to line up; a banknote issued by a country will often be printed in another." }} </p> - <table role="grid"> - <thead> - <tr> - <th>{{ .Get "Code" }}</th> - <th>{{ .Get "Country" }}</th> - <th>{{ .Get "Printer" }}</th> - </tr> - </thead> - <tbody> - <tr> - <td>D</td> - <td>{{ .GetC "Finland" "Place Name" }}</td> - {{ withTranslations "td" - (.GetC "SETEC" "Company Name" | toString) - (tuple "" "SETEC") }} - </tr> + <div class="overflow-auto"> + <table class="striped"> + <thead> + <tr> + <th>{{ .GetC "Code" "Header/Label" }}</th> + <th>{{ .GetC "Country" "Header/Label" }}</th> + <th> + {{ .GetC "Printer" "Header/Label" }}<br> + <span class="translation"> + {{ .GetC "Local Names" "Header/Label" }} + </span> + </th> + </tr> + </thead> + <tbody> + <tr> + <td>D</td> + <td>{{ .GetC "Finland" "Place Name" }}</td> + {{ withTranslations "td" + (.GetC "SETEC" "Company Name" | toString) + (tuple "" "SETEC") }} + </tr> + <tr> + <td>E</td> + <td>{{ .GetC "France" "Place Name" }}</td> + {{ withTranslations "td" + (.GetC "Oberthur" "Company Name" | toString) + (tuple "" "Oberthur") }} + </tr> + <tr> + <td>F</td> + <td>{{ .GetC "Austria" "Place Name" }}</td> + {{ withTranslations "td" + (.GetC "Austrian Banknote and Security Printing" "Company Name" | toString) + (tuple "de" "Oesterreichische Banknoten- und Sicherheitsdruck") }} + </tr> + <tr> + <td>G</td> + <td>{{ .GetC "Netherlands" "Place Name" }}</td> + {{ withTranslations "td" + (.GetC "Royal Joh. Enschedé" "Company Name" | toString) + (tuple "nl" "Koninklijke Joh. Enschedé") }} + </tr> + <tr> + <td>H</td> + <td>{{ .GetC "United Kingdom" "Place Name" }}</td> + {{ withTranslations "td" + (.GetC "De La Rue" "Company Name" | toString) + (tuple "" "De La Rue") }} + </tr> + <tr> + <td>J</td> + <td>{{ .GetC "Italy" "Place Name" }}</td> + {{ withTranslations "td" + (.GetC "Bank of Italy" "Company Name" | toString) + (tuple "it" "Banca d’Italia") }} + </tr> + <tr> + <td>K</td> + <td>{{ .GetC "Ireland" "Place Name" }}</td> + {{ withTranslations "td" + (.GetC "Central Bank of Ireland" "Company Name" | toString) + (tuple "ga" "Banc Ceannais na hÉireann") + (tuple "en" "Central Bank of Ireland") }} + </tr> + <tr> + <td>L</td> + <td>{{ .GetC "France" "Place Name" }}</td> + {{ withTranslations "td" + (.GetC "Bank of France" "Company Name" | toString) + (tuple "fr" "Banque du France") }} + </tr> + <tr> + <td>M</td> + <td>{{ .GetC "Spain" "Place Name" }}</td> + {{ withTranslations "td" + (.GetC "Royal Mint of Spain" "Company Name" | toString) + (tuple "es" "Fábrica Nacional de Moneda y Timbre") }} + </tr> + <tr> + <td>N</td> + <td>{{ .GetC "Greece" "Place Name" }}</td> + {{ withTranslations "td" + (.GetC "Bank of Greece" "Company Name" | toString) + (tuple "gr" "Τράπεζα της Ελλάδος") }} + </tr> + <tr> + <td>P</td> + <td>{{ .GetC "Germany" "Place Name" }}</td> + {{ withTranslations "td" + (.GetC "Giesecke+Devrient" "Company Name" | toString) + (tuple "de" "Giesecke+Devrient") }} + </tr> + <tr> + <td>R</td> + <td>{{ .GetC "Germany" "Place Name" }}</td> + {{ withTranslations "td" + (.GetC "Federal Printing Office" "Company Name" | toString) + (tuple "de" "Bundesdruckerei") }} + </tr> + <tr> + <td>T</td> + <td>{{ .GetC "Belgium" "Place Name" }}</td> + {{ withTranslations "td" + (.GetC "National Bank of Belgium" "Company Name" | toString) + (tuple "nl" "Nationale Bank van België") + (tuple "fr" "Banque nationale de Belgique") + (tuple "de" "Belgische Nationalbank") }} + </tr> + <tr> + <td>U</td> + <td>{{ .GetC "Portugal" "Place Name" }}</td> + {{ withTranslations "td" + (.GetC "Valora S.A." "Company Name" | toString) + (tuple "" "Valora S.A.") }} + </tr> + </tbody> + </table> + </div> + + + <h2>{{ .Get "Europa Series" }}</h2> + <p> + {{ .Get "In the Europa series the first letter of the serial number can be used to identify the printer that printed the banknote, just like the printer code. The following table shows which countries map to which codes." }} + </p> + + <div class="overflow-auto"> + <table class="striped"> + <thead> + <tr> + <th>{{ .GetC "Code" "Header/Label" }}</th> + <th>{{ .GetC "Country" "Header/Label" }}</th> + <th> + {{ .GetC "Printer" "Header/Label" }}<br> + <span class="translation"> + {{ .GetC "Local Names" "Header/Label" }} + </span> + </th> + </tr> + </thead> <tr> <td>E</td> <td>{{ .GetC "France" "Place Name" }}</td> @@ -156,34 +406,48 @@ </tr> <tr> <td>F</td> + <td>{{ .GetC "Bulgaria" "Place Name" }}</td> + {{ withTranslations "td" + (.GetC "Oberthur Fiduciaire AD" "Company Name" | toString) + (tuple "" "Oberthur Fiduciaire AD") }} + </tr> + <tr> + <td>M</td> + <td>{{ .GetC "Portugal" "Place Name" }}</td> + {{ withTranslations "td" + (.GetC "Valora S.A." "Company Name" | toString) + (tuple "" "Valora S.A.") }} + </tr> + <tr> + <td>N</td> <td>{{ .GetC "Austria" "Place Name" }}</td> {{ withTranslations "td" (.GetC "Austrian Banknote and Security Printing" "Company Name" | toString) (tuple "de" "Oesterreichische Banknoten- und Sicherheitsdruck") }} </tr> <tr> - <td>G</td> + <td>P</td> <td>{{ .GetC "Netherlands" "Place Name" }}</td> {{ withTranslations "td" (.GetC "Royal Joh. Enschedé" "Company Name" | toString) (tuple "nl" "Koninklijke Joh. Enschedé") }} </tr> <tr> - <td>H</td> - <td>{{ .GetC "United Kingdom" "Place Name" }}</td> + <td>R</td> + <td>{{ .GetC "Germany" "Place Name" }}</td> {{ withTranslations "td" - (.GetC "De La Rue" "Company Name" | toString) - (tuple "" "De La Rue") }} + (.GetC "Federal Printing Office" "Company Name" | toString) + (tuple "de" "Bundesdruckerei") }} </tr> <tr> - <td>J</td> + <td>S</td> <td>{{ .GetC "Italy" "Place Name" }}</td> {{ withTranslations "td" (.GetC "Bank of Italy" "Company Name" | toString) (tuple "it" "Banca d’Italia") }} </tr> <tr> - <td>K</td> + <td>T</td> <td>{{ .GetC "Ireland" "Place Name" }}</td> {{ withTranslations "td" (.GetC "Central Bank of Ireland" "Company Name" | toString) @@ -191,42 +455,42 @@ (tuple "en" "Central Bank of Ireland") }} </tr> <tr> - <td>L</td> + <td>U</td> <td>{{ .GetC "France" "Place Name" }}</td> {{ withTranslations "td" (.GetC "Bank of France" "Company Name" | toString) (tuple "fr" "Banque du France") }} </tr> <tr> - <td>M</td> + <td>V</td> <td>{{ .GetC "Spain" "Place Name" }}</td> {{ withTranslations "td" (.GetC "Royal Mint of Spain" "Company Name" | toString) (tuple "es" "Fábrica Nacional de Moneda y Timbre") }} </tr> <tr> - <td>N</td> - <td>{{ .GetC "Greece" "Place Name" }}</td> + <td>W</td> + <td>{{ .GetC "Germany" "Place Name" }}</td> {{ withTranslations "td" - (.GetC "Bank of Greece" "Company Name" | toString) - (tuple "gr" "Τράπεζα της Ελλάδος") }} + (.GetC "Giesecke+Devrient Leipzig" "Company Name" | toString) + (tuple "de" "Giesecke+Devrient Leipzig") }} </tr> <tr> - <td>P</td> + <td>X</td> <td>{{ .GetC "Germany" "Place Name" }}</td> {{ withTranslations "td" - (.GetC "Giesecke+Devrient" "Company Name" | toString) - (tuple "de" "Giesecke+Devrient") }} + (.GetC "Giesecke+Devrient Munich" "Company Name" | toString) + (tuple "de" "Giesecke+Devrient München") }} </tr> <tr> - <td>R</td> - <td>{{ .GetC "Germany" "Place Name" }}</td> + <td>Y</td> + <td>{{ .GetC "Greece" "Place Name" }}</td> {{ withTranslations "td" - (.GetC "Federal Printing Office" "Company Name" | toString) - (tuple "de" "Bundesdruckerei") }} + (.GetC "Bank of Greece" "Company Name" | toString) + (tuple "gr" "Τράπεζα της Ελλάδος") }} </tr> <tr> - <td>T</td> + <td>Z</td> <td>{{ .GetC "Belgium" "Place Name" }}</td> {{ withTranslations "td" (.GetC "National Bank of Belgium" "Company Name" | toString) @@ -234,130 +498,8 @@ (tuple "fr" "Banque nationale de Belgique") (tuple "de" "Belgische Nationalbank") }} </tr> - <tr> - <td>U</td> - <td>{{ .GetC "Portugal" "Place Name" }}</td> - {{ withTranslations "td" - (.GetC "Valora S.A." "Company Name" | toString) - (tuple "" "Valora S.A.") }} - </tr> - </tbody> - </table> - - <h2>{{ .Get "Europa Series" }}</h2> - <p> - {{ .Get "In the Europa series the first letter of the serial number can be used to identify the printer that printed the banknote, just like the printer code. The following table shows which countries map to which codes." }} - </p> - <table role="grid"> - <thead> - <tr> - <th>{{ .Get "Code" }}</th> - <th>{{ .Get "Country" }}</th> - <th>{{ .Get "Printer" }}</th> - </tr> - </thead> - <tr> - <td>E</td> - <td>{{ .GetC "France" "Place Name" }}</td> - {{ withTranslations "td" - (.GetC "Oberthur" "Company Name" | toString) - (tuple "" "Oberthur") }} - </tr> - <tr> - <td>F</td> - <td>{{ .GetC "Bulgaria" "Place Name" }}</td> - {{ withTranslations "td" - (.GetC "Oberthur Fiduciaire AD" "Company Name" | toString) - (tuple "" "Oberthur Fiduciaire AD") }} - </tr> - <tr> - <td>M</td> - <td>{{ .GetC "Portugal" "Place Name" }}</td> - {{ withTranslations "td" - (.GetC "Valora S.A." "Company Name" | toString) - (tuple "" "Valora S.A.") }} - </tr> - <tr> - <td>N</td> - <td>{{ .GetC "Austria" "Place Name" }}</td> - {{ withTranslations "td" - (.GetC "Austrian Banknote and Security Printing" "Company Name" | toString) - (tuple "de" "Oesterreichische Banknoten- und Sicherheitsdruck") }} - </tr> - <tr> - <td>P</td> - <td>{{ .GetC "Netherlands" "Place Name" }}</td> - {{ withTranslations "td" - (.GetC "Royal Joh. Enschedé" "Company Name" | toString) - (tuple "nl" "Koninklijke Joh. Enschedé") }} - </tr> - <tr> - <td>R</td> - <td>{{ .GetC "Germany" "Place Name" }}</td> - {{ withTranslations "td" - (.GetC "Federal Printing Office" "Company Name" | toString) - (tuple "de" "Bundesdruckerei") }} - </tr> - <tr> - <td>S</td> - <td>{{ .GetC "Italy" "Place Name" }}</td> - {{ withTranslations "td" - (.GetC "Bank of Italy" "Company Name" | toString) - (tuple "it" "Banca d’Italia") }} - </tr> - <tr> - <td>T</td> - <td>{{ .GetC "Ireland" "Place Name" }}</td> - {{ withTranslations "td" - (.GetC "Central Bank of Ireland" "Company Name" | toString) - (tuple "ga" "Banc Ceannais na hÉireann") - (tuple "en" "Central Bank of Ireland") }} - </tr> - <tr> - <td>U</td> - <td>{{ .GetC "France" "Place Name" }}</td> - {{ withTranslations "td" - (.GetC "Bank of France" "Company Name" | toString) - (tuple "fr" "Banque du France") }} - </tr> - <tr> - <td>V</td> - <td>{{ .GetC "Spain" "Place Name" }}</td> - {{ withTranslations "td" - (.GetC "Royal Mint of Spain" "Company Name" | toString) - (tuple "es" "Fábrica Nacional de Moneda y Timbre") }} - </tr> - <tr> - <td>W</td> - <td>{{ .GetC "Germany" "Place Name" }}</td> - {{ withTranslations "td" - (.GetC "Giesecke+Devrient Leipzig" "Company Name" | toString) - (tuple "de" "Giesecke+Devrient Leipzig") }} - </tr> - <tr> - <td>X</td> - <td>{{ .GetC "Germany" "Place Name" }}</td> - {{ withTranslations "td" - (.GetC "Giesecke+Devrient Munich" "Company Name" | toString) - (tuple "de" "Giesecke+Devrient München") }} - </tr> - <tr> - <td>Y</td> - <td>{{ .GetC "Greece" "Place Name" }}</td> - {{ withTranslations "td" - (.GetC "Bank of Greece" "Company Name" | toString) - (tuple "gr" "Τράπεζα της Ελλάδος") }} - </tr> - <tr> - <td>Z</td> - <td>{{ .GetC "Belgium" "Place Name" }}</td> - {{ withTranslations "td" - (.GetC "National Bank of Belgium" "Company Name" | toString) - (tuple "nl" "Nationale Bank van België") - (tuple "fr" "Banque nationale de Belgique") - (tuple "de" "Belgische Nationalbank") }} - </tr> - </table> + </table> + </div> </main> {{ end }} @@ -365,13 +507,14 @@ {{ $p := (index . 0) }} {{ $d := (index . 1) }} {{ $args := (map "N" $d) }} -<details> +<details name="printer-codes-1"> {{/* TRANSLATORS: As in ‘5 Euro Banknote’ */}} <summary>{{ $p.GetN "{N} Euro" "{N} Euro" $d $args }}</summary> - <img - class="big" - src={{ printf "/codes/%s-%03d.jpg" (index . 2) $d }} - alt={{ $p.GetN "Printer code on a {N} euro bill" "Printer code on a {N} euro bill" $d $args }} - > + <div class="design-container"> + <img + src={{ printf "/codes/%s-%03d.jpg" (index . 2) $d }} + alt={{ $p.GetN "Printer code on a {N} euro bill" "Printer code on a {N} euro bill" $d $args }} + > + </div> </details> {{ end }}
\ No newline at end of file diff --git a/src/templates/banknotes.html.tmpl b/src/templates/banknotes.html.tmpl index 750b4db..8a50dfa 100644 --- a/src/templates/banknotes.html.tmpl +++ b/src/templates/banknotes.html.tmpl @@ -1,50 +1,52 @@ {{ define "header" }} {{ template "header-navbar" . }} + +<style> + #sections { + --button-min-width: 40ch; + + article { + min-height: 100%; + } + } +</style> {{ end }} {{ define "content" }} -<header> +<header class="container"> {{ template "navbar" . }} <h1>{{ .Get "Euro Banknotes" }}</h1> </header> -<main> +<main class="container"> <p> {{ .Get "On this section of the site you can find everything there is to know about the banknotes of the Eurozone." }} </p> <hr> - <section> - <div class="grid"> - <a class="no-deco" href="/banknotes/designs"> - <article> - <header> - <h3>{{ .Get "Designs" }}</h3> - </header> - <main> - {{ .Get "View the different Euro banknote designs" }} - </main> - </article> - </a> - <a class="no-deco" href="/banknotes/codes"> - <article> - <header> - <h3>{{ .Get "Location Codes" }}</h3> - </header> - <main> - {{ .Get "Find out where your notes were printed" }} - </main> - </article> - </a> - <a class="no-deco" href="/banknotes/test"> - <article> - <header> - <h3>{{ .Get "Test Notes" }}</h3> - </header> - <main> - {{ .Get "Learn about the special test notes" }} - </main> - </article> - </a> - </div> - </section> + <div id="sections" class="button-grid"> + <a class="no-deco" href="/banknotes/designs"> + <article> + <header> + <h3>{{ .Get "Designs" }}</h3> + </header> + {{ .Get "View the different Euro banknote designs" }} + </article> + </a> + <a class="no-deco" href="/banknotes/codes"> + <article> + <header> + <h3>{{ .Get "Location Codes" }}</h3> + </header> + {{ .Get "Find out where your notes were printed" }} + </article> + </a> + <a class="no-deco" href="/banknotes/test"> + <article> + <header> + <h3>{{ .Get "Test Notes" }}</h3> + </header> + {{ .Get "Learn about the special test notes" }} + </article> + </a> + </div> </main> {{ end }}
\ No newline at end of file diff --git a/src/templates/coins-mintages.html.tmpl b/src/templates/coins-mintages.html.tmpl index 7658ce7..ee8bc75 100644 --- a/src/templates/coins-mintages.html.tmpl +++ b/src/templates/coins-mintages.html.tmpl @@ -5,63 +5,103 @@ #mintage-table #mintage-table-cc { white-space: nowrap; } + + label[for="country-dd"] { display: none; } + label[for="year-dd"] { display: none; } + + form { + &:has(#country:checked) { + label[for="country-dd"] { display: unset; } + } + &:has(#year:checked) { + label[for="year-dd"] { display: unset; } + } + } </style> {{ end }} {{ define "content" }} -<header> +<header class="container"> {{ template "navbar" . }} <h1>{{ .Get "Euro Coin Mintages" }}</h1> </header> -<main> +<main class="container"> <p> {{ .Get "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 /> + <hr> {{ if eq .Code "nl" }} - <h2>{{ .Get "Additional Notes" }}</h2> - <ul> - <li> - {{ .Get "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, {Link:l}click here{-:E}." + <h2>{{ .Get "Additional Notes" }}</h2> + <ul> + <li> + {{ .Get "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, {Link:l}click here{-:E}." (map "Link" "#TODO") }} - </li> - </ul> + </li> + </ul> {{ end }} - <section> - <form> - <div class="grid"> - <label for="country-dd"> - {{ .Get "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" (.Get "Circulation Coins")) }} - {{ template "coin-type-radio" - (tuple .Type "nifc" (.Get "NIFC / BU Sets")) }} - {{ template "coin-type-radio" - (tuple .Type "proof" (.Get "Proof Coins")) }} - </fieldset> - </div> - <button type="submit">{{ .Get "Filter" }}</button> - </form> - <figure> - <figcaption>{{ .Get "Standard Issue Coins" }}</figcaption> - <table id="mintage-table" role="grid"> + <form> + <div class="grid"> + <fieldset> + <legend>{{ .GetC "Filter Method" "Header/Label" }}</legend> + {{ template "mintages/filter-radio" + (tuple .FilterBy "country" (.GetC "Country" "Header/Label")) }} + {{ template "mintages/filter-radio" + (tuple .FilterBy "year" (.GetC "Year" "Header/Label")) }} + </fieldset> + + <label for="country-dd"> + {{ .GetC "Country" "Header/Label" }} + <select id="country-dd" name="country"> + {{ $code := .Code }} + {{ range .Countries }} + <option + value="{{ .Code }}" + {{ if eq .Code $code }} + selected + {{ end }} + > + {{ .Name }} + </option> + {{ end }} + </select> + </label> + + <label for="year-dd"> + {{ .GetC "Year" "Header/Label" }} + <select id="year-dd" name="year"> + {{ $year := .Year }} + {{ range years }} + <option + value="{{ . }}" + {{ if eq . $year }} + selected + {{ end }} + > + {{ . }} + </option> + {{ end }} + </select> + </label> + + <fieldset> + {{ template "mintages/coin-type-radio" + (tuple .Type "circ" (.Get "Circulation Coins")) }} + {{ template "mintages/coin-type-radio" + (tuple .Type "nifc" (.Get "NIFC / BU Sets")) }} + {{ template "mintages/coin-type-radio" + (tuple .Type "proof" (.Get "Proof Coins")) }} + </fieldset> + </div> + <button type="submit">{{ .GetC "Filter" "Header/Label" }}</button> + </form> + <figure> + <figcaption>{{ .Get "Standard Issue Coins" }}</figcaption> + <div class="overflow-auto"> + {{ if eq .FilterBy "country" }} + + <table id="mintage-table-country" class="striped" role="grid"> <thead> - <th>{{ .Get "Year" }}</th> + <th>{{ .GetC "Year" "Header/Label" }}</th> <th data-numeric>{{ .Printer.Ftom 0.01 }}</th> <th data-numeric>{{ .Printer.Ftom 0.02 }}</th> <th data-numeric>{{ .Printer.Ftom 0.05 }}</th> @@ -73,74 +113,126 @@ </thead> <tbody> {{ $p := .Printer }} - {{ range .Mintages.Standard }} + {{ range .CountryMintages.Standard }} <tr> - <th scope="col"> + <th scope="row"> {{- .Year -}} {{- if ne .Mintmark "" -}} <sub><small>{{ .Mintmark }}</small></sub> {{- end -}} </th> {{ range .Mintages }} - {{ if eq . -1 }} - <td data-numeric>{{ $p.Get "Unknown" }}</td> - {{ else if eq . -2 }} - <td data-numeric class="error">{{ $p.Get "Error" }}</td> - {{ else if eq . 0 }} - <td data-numeric>—</td> - {{ else }} - <td data-numeric>{{ $p.Itoa . }}</td> - {{ end }} - </td> + {{ template "mintages/mintage-cell" (tuple . $p) }} {{ end }} </tr> {{ end }} </tbody> </table> + + {{ else if eq .FilterBy "year" }} + + <table id="mintage-table-year" class="striped" role="grid"> + <thead> + <th>{{ .GetC "Country" "Header/Label" }}</th> + <th data-numeric>{{ .Printer.Ftom 0.01 }}</th> + <th data-numeric>{{ .Printer.Ftom 0.02 }}</th> + <th data-numeric>{{ .Printer.Ftom 0.05 }}</th> + <th data-numeric>{{ .Printer.Ftom 0.10 }}</th> + <th data-numeric>{{ .Printer.Ftom 0.20 }}</th> + <th data-numeric>{{ .Printer.Ftom 0.50 }}</th> + <th data-numeric>{{ .Printer.Ftom 1.00 }}</th> + <th data-numeric>{{ .Printer.Ftom 2.00 }}</th> + </thead> + <tbody> + {{ $p := .Printer }} + {{ range .YearMintages.Standard }} + <tr> + <th scope="row"> + {{- .Country -}} + {{- if ne .Mintmark "" -}} + <sub><small>{{ .Mintmark }}</small></sub> + {{- end -}} + </th> + {{ range .Mintages }} + {{ template "mintages/mintage-cell" (tuple . $p) }} + {{ end }} + </tr> + {{ end }} + </tbody> + </table> + {{ end }} + </div> + </figure> + + {{ if eq .FilterBy "country" }} + {{ if ne (len .CountryMintages.Commemorative) 0 }} + <figure> + <figcaption>{{ .Get "Commemorative Coins" }}</figcaption> + <table id="mintage-table-cc" class="striped" role="grid"> + <thead> + <th>{{ .GetC "Year" "Header/Label" }}</th> + <th>{{ .GetC "Commemorated Topic" "Header/Label" }}</th> + <th data-numeric>{{ .GetC "Mintage" "Header/Label" }}</th> + </thead> + <tbody> + {{ $p := .Printer }} + {{ range .CountryMintages.Commemorative }} + <tr> + <th scope="row"> + {{- .Year -}} + {{- if ne .Mintmark "" -}} + <sub><small>{{ .Mintmark }}</small></sub> + {{- end -}} + </th> + <!-- TODO: Translate commemorative names --> + <td>{{ .Name }}</td> + {{ with .Mintage }} + {{ template "mintages/mintage-cell" (tuple . $p) }} + {{ end }} + </tr> + {{ end }} + </tbody> + </table> </figure> - {{ if ne (len .Mintages.Commemorative) 0 }} - <figure> - <figcaption>{{ .Get "Commemorative Coins" }}</figcaption> - <table id="mintage-table-cc" role="grid"> - <thead> - <th>{{ .Get "Year" }}</th> - <th>{{ .Get "Commemorated Issue" }}</th> - <th>{{ .Get "Mintage" }}</th> - </thead> - <tbody> - {{ $p := .Printer }} - {{ range .Mintages.Commemorative }} - <tr> - <th scope="col"> - {{- .Year -}} - {{- if ne .Mintmark "" -}} - <sub><small>{{ .Mintmark }}</small></sub> - {{- end -}} - </th> - <!-- TODO: Translate commemorative names --> - <td>{{ .Name }}</td> - {{ with .Mintage }} - {{ if eq . -1 }} - <td data-numeric>{{ $p.Get "Unknown" }}</td> - {{ else if eq . -2 }} - <td data-numeric class="error">{{ $p.Get "Error" }}</td> - {{ else if eq . 0 }} - <td data-numeric>—</td> - {{ else }} - <td data-numeric>{{ $p.Itoa . }}</td> - {{ end }} - {{ end }} - </tr> + {{ end }} + + {{ else if eq .FilterBy "year" }} + + {{ if ne (len .YearMintages.Commemorative) 0 }} + <figure> + <figcaption>{{ .Get "Commemorative Coins" }}</figcaption> + <table id="mintage-table-cc" class="striped" role="grid"> + <thead> + <th>{{ .GetC "Country" "Header/Label" }}</th> + <th>{{ .GetC "Commemorated Topic" "Header/Label" }}</th> + <th data-numeric>{{ .GetC "Mintage" "Header/Label" }}</th> + </thead> + <tbody> + {{ $p := .Printer }} + {{ range .YearMintages.Commemorative }} + <tr> + <th scope="row"> + {{- .Country -}} + {{- if ne .Mintmark "" -}} + <sub><small>{{ .Mintmark }}</small></sub> + {{- end -}} + </th> + <!-- TODO: Translate commemorative names --> + <td>{{ .Name }}</td> + {{ with .Mintage }} + {{ template "mintages/mintage-cell" (tuple . $p) }} {{ end }} - </tbody> - </table> - </figure> + </tr> + {{ end }} + </tbody> + </table> + </figure> {{ end }} - </section> + {{ end }} </main> {{ end }} -{{ define "coin-type-radio" }} +{{ define "mintages/coin-type-radio" }} <label for="{{ index . 1 }}"> <input id="{{ index . 1 }}" @@ -148,9 +240,39 @@ type="radio" value="{{ index . 1 }}" {{ if eq (index . 0) (index . 1) }} - checked + checked {{ end }} /> {{ index . 2 }} </label> +{{ end }} + +{{ define "mintages/filter-radio" }} +{{ $v := index . 1 }} +<label for="{{ $v }}"> + <input + name="filter-by" + type="radio" + value="{{ $v }}" + id="{{ $v }}" + {{ if eq (index . 0) $v }} + checked + {{ end }} + > + {{ index . 2 }} +</label> +{{ end }} + +{{ define "mintages/mintage-cell" }} +{{ $v := index . 0 }} +{{ $p := index . 1 }} +{{ if eq $v -1 }} + <td data-numeric>{{ $p.Get "Unknown" }}</td> +{{ else if eq $v -2 }} + <td data-numeric class="error">{{ $p.Get "Error" }}</td> +{{ else if eq $v 0 }} + <td data-numeric>—</td> +{{ else }} + <td data-numeric>{{ $p.Itoa $v }}</td> +{{ end }} {{ end }}
\ No newline at end of file diff --git a/src/templates/coins.html.tmpl b/src/templates/coins.html.tmpl index cc8eea1..ee36ed8 100644 --- a/src/templates/coins.html.tmpl +++ b/src/templates/coins.html.tmpl @@ -1,50 +1,52 @@ {{ define "header" }} {{ template "header-navbar" . }} + +<style> + #sections { + --button-min-width: 40ch; + + article { + min-height: 100%; + } + } +</style> {{ end }} {{ define "content" }} -<header> +<header class="container"> {{ template "navbar" . }} <h1>{{ .Get "Euro Coins" }}</h1> </header> -<main> +<main class="container"> <p> {{ .Get "On this section of the site you can find everything there is to know about the coins of the Eurozone." }} </p> <hr /> - <section> - <div class="grid"> - <a class="no-deco" href="/coins/designs"> - <article> - <header> - <h3>{{ .Get "Designs" }}</h3> - </header> - <main> - {{ .Get "View the 600+ different Euro-coin designs" }} - </main> - </article> - </a> - <a class="no-deco" href="/coins/mintages"> - <article> - <header> - <h3>{{ .Get "Mintages" }}</h3> - </header> - <main> - {{ .Get "View the mintage figures of all the Euro coins" }} - </main> - </article> - </a> - <a class="no-deco" href="/coins/varieties"> - <article> - <header> - <h3>{{ .Get "Varieties" }}</h3> - </header> - <main> - {{ .Get "View all the known Euro varieties" }} - </main> - </article> - </a> - </div> - </section> + <div id="sections" class="button-grid"> + <a class="no-deco" href="/coins/designs"> + <article> + <header> + <h3>{{ .Get "Designs" }}</h3> + </header> + {{ .Get "View the 600+ different Euro-coin designs" }} + </article> + </a> + <a class="no-deco" href="/coins/mintages"> + <article> + <header> + <h3>{{ .Get "Mintages" }}</h3> + </header> + {{ .Get "View the mintage figures of all the Euro coins" }} + </article> + </a> + <a class="no-deco" href="/coins/varieties"> + <article> + <header> + <h3>{{ .Get "Varieties" }}</h3> + </header> + {{ .Get "View all the known Euro varieties" }} + </article> + </a> + </div> </main> {{ end }}
\ No newline at end of file diff --git a/src/templates/collecting-crh.html.tmpl b/src/templates/collecting-crh.html.tmpl index 9efa746..0fe19a4 100644 --- a/src/templates/collecting-crh.html.tmpl +++ b/src/templates/collecting-crh.html.tmpl @@ -3,12 +3,12 @@ {{ end }} {{ define "content" }} -<header> +<header class="container"> {{ template "navbar" . }} <h1>{{ .Get "Coin Roll Hunting" }}</h1> </header> -<main> - <h2>{{ .Get "What is Coin Roll Hunting?" }}</h2> +<main class="container"> + <h2>{{ .Get "What is ‘Coin Roll Hunting’?" }}</h2> <p> {{ .Get "Coin roll hunting is a popular method of coin collecting in which you withdraw cash from your bank in the form of coins and then search through those coins to find new additions to your collection. Once you’ve searched through all your coins, you will typically deposit your left over coins at the bank and withdraw new coins." }} </p> @@ -43,494 +43,500 @@ {{ .Get "Be aware of the fact that the information below may be outdated or inaccurate. Many of the details are self-reported." }} </p> - {{ $p := .Printer }} - {{ range .Countries }} - <details id="{{ .Code }}"> - <summary>{{ .Name }}</summary> - {{ if eq .Code "ad" }} - <p> - {{ $p.Get "Coin rolls can be obtained from Andbank, Creand and MoraBanc. All three of these banks require that you are a customer to get rolls, however there have been reports of individuals managing to get rolls without any fees and without being a customer by simply asking kindly at the bank." }} - </p> - {{ else if eq .Code "at" }} - {{/* TRANSLATORS: The OeNB prefers ‘Oe’ over ‘Ö’ */}} - {{ withTranslations "h3" + <article> + {{ $p := .Printer }} + {{ $countries := .Countries }} + {{ range $i, $c := $countries }} + <details id="{{ $c.Code }}" name="country"> + <summary>{{ $c.Name }}</summary> + {{ if eq $c.Code "ad" }} + <p> + {{ $p.Get "Coin rolls can be obtained from Andbank, Creand and MoraBanc. All three of these banks require that you are a customer to get rolls, however there have been reports of individuals managing to get rolls without any fees and without being a customer by simply asking kindly at the bank." }} + </p> + {{ else if eq $c.Code "at" }} + {{/* TRANSLATORS: The OeNB prefers ‘Oe’ over ‘Ö’ */}} + {{ withTranslations "h3" ($p.GetC "Austrian National Bank" "Company Name") (tuple "de" "Oesterreichische Nationalbank") }} - <p> - {{ $p.Get "The Austrian National Bank does not distribute circulated rolls but sells rolls of commemorative coins at face value on release as well as uncirculated rolls for all denominations." }} - </p> + <p> + {{ $p.Get "The Austrian National Bank does not distribute circulated rolls but sells rolls of commemorative coins at face value on release as well as uncirculated rolls for all denominations." }} + </p> - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "Bank Austria" "Company Name") (tuple "de" "Bank Austria") }} - <p> - {{ $link := ifElse (eq $p.Language "de") + <p> + {{ $link := ifElse (eq $p.Language "de") "https://filialen.bankaustria.at/de" "https://filialen.bankaustria.at/en" }} - {{/* TRANSLATORS: On the German page the filter is called ‘Münzrollengeber’. For other languages we link to the English site, so mention the English filter name surrounded by ‘{EnglishStart:r}’ and ‘{EnglishEnd:E}’, and also translate it in parenthesis to your language. For example the Swedish page might say: ‘”{EnglishStart:r}coin roll dispenser{EnglishEnd:E}” (svenska: ”myntrullsautomat”)’ */}} - {{ $p.Get "There is a fee of €0.20 per roll which can be purchased with cash at machines. These machines are available to everyone but not in all branches. Look for the ‘coin roll dispenser’ filter option {Link:L}here{-:E}." - (map "Link" $link "EnglishStart" + {{/* TRANSLATORS: On the German page the filter is called ‘Münzrollengeber’. For other languages we link to the English site, so mention the English filter name surrounded by ‘{EnglishStart:r}’ and ‘{EnglishEnd:E}’, and also translate it in parenthesis to your language. For example the Swedish page might say: ‘”{EnglishStart:r}coin roll dispenser{EnglishEnd:E}” (svenska: ”myntrullsautomat”)’ */}} + {{ $p.Get "There is a fee of €0.20 per roll which can be purchased with cash at machines. These machines are available to everyone but not in all branches. Look for the ‘coin roll dispenser’ filter option {Link:L}here{-:E}." + (map "Link" $link "EnglishStart" `<span lang="en"><em>` "EnglishEnd" "em,span") | safe }} - </p> + </p> - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "Erste Bank" "Company Name") (tuple "de" "Erste Bank") }} - <p> - {{ $p.Get "There is a fee of €0.10 per roll. You must be a customer to use machines to get rolls. Rolls have no fees when purchased at counters, but you will probably be redirected to the machines if they work. You must present an Erste Bank card to buy rolls from machines, however payment in cash is still accepted." }} - </p> + <p> + {{ $p.Get "There is a fee of €0.10 per roll. You must be a customer to use machines to get rolls. Rolls have no fees when purchased at counters, but you will probably be redirected to the machines if they work. You must present an Erste Bank card to buy rolls from machines, however payment in cash is still accepted." }} + </p> - <p> - {{ $p.Get "Depositing coins is free up to €100 a day, at which point you pay 1% for any additionally deposited coins. You must also be a customer. Depositing coins is free for all Erste Bank customers at Dornbirner Sparkasse with no limit." }} - </p> + <p> + {{ $p.Get "Depositing coins is free up to €100 a day, at which point you pay 1% for any additionally deposited coins. You must also be a customer. Depositing coins is free for all Erste Bank customers at Dornbirner Sparkasse with no limit." }} + </p> - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "Raiffeisen Bank" "Company Name") (tuple "de" "Raiffeisen Bank") }} - <p> - {{ $p.Get "There is a fee of €1 per roll if you aren’t a customer and €0.30 otherwise. Coin deposits are free for customers." }} - </p> + <p> + {{ $p.Get "There is a fee of €1 per roll if you aren’t a customer and €0.30 otherwise. Coin deposits are free for customers." }} + </p> - {{ else if eq .Code "be" }} + {{ else if eq $c.Code "be" }} - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "National Bank of Belgium" "Company Name") (tuple "nl" "Nationale Bank van België") (tuple "fr" "Banque nationale de Belgique") (tuple "de" "Belgische Nationalbank") }} - <p> - {{ $p.Get "You can visit the National Bank of Belgium in Brussels as an EU citizen. You can order coin rolls for no fee up to €2000 in value. They seem to distribute only uncirculated coins and no commemoratives." }} - </p> + <p> + {{ $p.Get "You can visit the National Bank of Belgium in Brussels as an EU citizen. You can order coin rolls for no fee up to €2000 in value. They seem to distribute only uncirculated coins and no commemoratives." }} + </p> - {{/* TRANSLATORS: Name of a bank */}} - {{ withTranslations "h3" + {{/* TRANSLATORS: Name of a bank */}} + {{ withTranslations "h3" ($p.GetC "Argenta" "Company Name") (tuple "" "Argenta") }} - <p> - {{ $p.Get "There is a €1.50 fee per transaction with no limit on the number of rolls you may take." }} - </p> + <p> + {{ $p.Get "There is a €1.50 fee per transaction with no limit on the number of rolls you may take." }} + </p> - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "KBC Bank" "Company Name") (tuple "" "KBC Bank") }} - <p> - {{ $p.Get "Rolls can be obtained with no fee by customers only" }} - </p> + <p> + {{ $p.Get "Rolls can be obtained with no fee by customers only" }} + </p> - {{/* TRANSLATORS: Name of a bank */}} - {{ withTranslations "h3" + {{/* TRANSLATORS: Name of a bank */}} + {{ withTranslations "h3" ($p.GetC "Belfius" "Company Name") (tuple "" "Belfius") }} - <p> - {{ $p.Get "Rolls can be obtained with no fee when you order through their online platform." }} - </p> + <p> + {{ $p.Get "Rolls can be obtained with no fee when you order through their online platform." }} + </p> - {{ else if eq .Code "cy" }} + {{ else if eq $c.Code "cy" }} - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "Bank of Cyprus" "Company Name") (tuple "el" "Τράπεζα Κύπρου") (tuple "tr" "Kıbrıs Bankası") }} - <p> - {{ $p.Get "At the Bank of Cyprus it is possible to buy bags of coins without being a customer, and without paying any additional fees. Depending on the branch you visit there may be a coin roll machine available. Do note that the bags provided by the Bank of Cyprus are much larger than what is typically found elsewhere in the Eurozone with €2.00 bags containing 50 coins and the other denomination bags containing 100 coins." }} - </p> + <p> + {{ $p.Get "At the Bank of Cyprus it is possible to buy bags of coins without being a customer, and without paying any additional fees. Depending on the branch you visit there may be a coin roll machine available. Do note that the bags provided by the Bank of Cyprus are much larger than what is typically found elsewhere in the Eurozone with €2.00 bags containing 50 coins and the other denomination bags containing 100 coins." }} + </p> - {{ else if eq .Code "de" }} + {{ else if eq $c.Code "de" }} - <p> - {{ $p.Get "Coin roll availability and their related fees may vary across banks and branches. Unless specified otherwise, you must be a customer to purchase coin rolls." }} - </p> + <p> + {{ $p.Get "Coin roll availability and their related fees may vary across banks and branches. Unless specified otherwise, you must be a customer to purchase coin rolls." }} + </p> - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "German Federal Bank" "Company Name") (tuple "de" "Deutsche Bundesbank") }} - <p> - {{ $p.Get "You can obtain regular and commemorative coins for face value including 5-, 10- and 20 euro coins. You do not need to be a customer although depending on your branch you may need to make an appointment. The purchase of coins can only be done with cash." }} - </p> + <p> + {{ $p.Get "You can obtain regular and commemorative coins for face value including 5-, 10- and 20 euro coins. You do not need to be a customer although depending on your branch you may need to make an appointment. The purchase of coins can only be done with cash." }} + </p> - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "German Post" "Company Name") (tuple "de" "Deutsche Post") }} - <p> - {{ $p.Get "Hand-rolled coin rolls can be obtained with no additional fees." }} - </p> + <p> + {{ $p.Get "Hand-rolled coin rolls can be obtained with no additional fees." }} + </p> - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "Sparkasse" "Company Name") (tuple "de" "Sparkasse") }} - <p> - {{ $p.Get "Coin rolls can be obtained for a fee of €0.50–€1.50 per roll. The amount varies per branch." }} - </p> + <p> + {{ $p.Get "Coin rolls can be obtained for a fee of €0.50–€1.50 per roll. The amount varies per branch." }} + </p> - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "Volksbank" "Company Name") (tuple "de" "Volksbank") }} - <p> - {{ $p.Get "Coin rolls can be obtained for a fee of €0.25 per roll." }} - </p> + <p> + {{ $p.Get "Coin rolls can be obtained for a fee of €0.25 per roll." }} + </p> - {{ else if eq .Code "ee" }} + {{ else if eq $c.Code "ee" }} - <p> - {{ $p.Get "Obtaining coin rolls in Estonia is typically quite difficult and often expensive. You also generally need to make an appointment in advance." }} - </p> + <p> + {{ $p.Get "Obtaining coin rolls in Estonia is typically quite difficult and often expensive. You also generally need to make an appointment in advance." }} + </p> - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "Bank of Estonia Museum" "Company Name") (tuple "et" "Eesti Panga muuseum") }} - <p> - {{ $p.Get "You can purchase commemorative coins — including those released years ago — for face value." }} - </p> + <p> + {{ $p.Get "You can purchase commemorative coins — including those released years ago — for face value." }} + </p> - {{ else if eq .Code "es" }} + {{ else if eq $c.Code "es" }} - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "Bank of Spain" "Company Name") (tuple "es" "Banco de España") }} - <p> - {{ $p.Get "You can purchase individual coins and commemorative coin rolls (even those of other countries). You can watch a video {Link:L}here{-:E} to see how to do it." - (map "Link" "https://youtu.be/QRFuD6olH80?t=135") | safe }} - </p> + <p> + {{ $p.Get "You can purchase individual coins and commemorative coin rolls (even those of other countries). You can watch a video {Link:L}here{-:E} to see how to do it." + (map "Link" "https://youtu.be/QRFuD6olH80?t=135") | safe }} + </p> - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "Royal Mint of Spain" "Company Name") (tuple "es" "Fábrica Nacional de Moneda y Timbre") }} - <p>TODO</p> + <p>TODO</p> - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "Santander Bank" "Company Name") (tuple "es" "Banco Santander") }} - <p>{{ $p.Get "Coin rolls are free but you must be a customer." }}</p> + <p>{{ $p.Get "Coin rolls are free but you must be a customer." }}</p> - {{/* TRANSLATORS: Name of a bank */}} - {{ withTranslations "h3" + {{/* TRANSLATORS: Name of a bank */}} + {{ withTranslations "h3" ($p.GetC "BBVA" "Company Name") (tuple "es" "BBVA") }} - <dl> - {{/* TRANSLATORS: City in Spain */}} - <dt>{{ $p.Get "Alicante" }}</dt> - <dd> - {{ $p.Get "Coin rolls have a fee of €2 for 5 rolls. This seems to vary by location." }} - </dd> - <dt>{{ $p.Get "Madrid" }}</dt> - <dd>{{ $p.Get "Coin rolls have no fees." }}</dd> - </dl> - - {{/* TRANSLATORS: Name of a bank */}} - {{ withTranslations "h3" + <dl> + {{/* TRANSLATORS: City in Spain */}} + <dt>{{ $p.Get "Alicante" }}</dt> + <dd> + {{ $p.Get "Coin rolls have a fee of €2 for 5 rolls. This seems to vary by location." }} + </dd> + <dt>{{ $p.Get "Madrid" }}</dt> + <dd>{{ $p.Get "Coin rolls have no fees." }}</dd> + </dl> + + {{/* TRANSLATORS: Name of a bank */}} + {{ withTranslations "h3" ($p.GetC "La Caixa" "Company Name") (tuple "es" "La Caixa") }} - <p> - {{ $p.Get "Coin rolls have no fees and can be purchased with cash. You allegedly do not need to be a customer, but this needs to be verified." }} - </p> + <p> + {{ $p.Get "Coin rolls have no fees and can be purchased with cash. You allegedly do not need to be a customer, but this needs to be verified." }} + </p> - {{ else if eq .Code "fi" }} + {{ else if eq $c.Code "fi" }} - <p> - {{ $p.Get "Finland has no coin roll machines, but you can find vending machines or coin exchange machines that accept cash (although they can be rather rare)." }} - </p> + <p> + {{ $p.Get "Finland has no coin roll machines, but you can find vending machines or coin exchange machines that accept cash (although they can be rather rare)." }} + </p> - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "Bank of Finland" "Company Name") (tuple "fi" "Suomen Pankki") (tuple "sv" "Finlands Bank") }} - <p> - {{ $p.Get "It is probably not possible to obtain coin rolls, but this is not confirmed." }} - </p> + <p> + {{ $p.Get "It is probably not possible to obtain coin rolls, but this is not confirmed." }} + </p> - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "Mint of Finland" "Company Name") (tuple "fi" "Suomen Rahapaja") (tuple "sv" "Myntverket i Finland") }} - <p>{{ $p.Get "The Mint of Finland ceased all operations in late 2024 but still sells coins on their website." }}</p> + <p>{{ $p.Get "The Mint of Finland ceased all operations in late 2024 but still sells coins on their website." }}</p> - {{/* TRANSLATORS: Name of a bank */}} - {{ withTranslations "h3" + {{/* TRANSLATORS: Name of a bank */}} + {{ withTranslations "h3" ($p.GetC "Aktia Bank" "Company Name") (tuple "fi" "Aktia Pankki") (tuple "sv" "Aktia Bank") }} - <p>{{ $p.Get "Coin rolls used to be obtainable without fees, however you can no longer obtain rolls." }}</p> + <p>{{ $p.Get "Coin rolls used to be obtainable without fees, however you can no longer obtain rolls." }}</p> - {{ else if eq .Code "fr" }} + {{ else if eq $c.Code "fr" }} - <p> - {{ $p.Get "Coin roll machines are uncommon, only some banks have them and you typically need to be a customer. You may also need to order coin rolls in advance." }} - </p> + <p> + {{ $p.Get "Coin roll machines are uncommon, only some banks have them and you typically need to be a customer. You may also need to order coin rolls in advance." }} + </p> - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "Bank of France" "Company Name") (tuple "fr" "Banque du France") }} - <p>TODO</p> + <p>TODO</p> - {{/* TRANSLATORS: Name of a bank */}} - {{ withTranslations "h3" + {{/* TRANSLATORS: Name of a bank */}} + {{ withTranslations "h3" ($p.GetC "Caisse d’Épargne" "Company Name") (tuple "fr" "Caisse d’Épargne") }} - <p>{{ $p.Get "Coin rolls can be obtained with no fee. You must be a customer." }}</p> + <p>{{ $p.Get "Coin rolls can be obtained with no fee. You must be a customer." }}</p> - {{/* TRANSLATORS: Name of a bank */}} - {{ withTranslations "h3" + {{/* TRANSLATORS: Name of a bank */}} + {{ withTranslations "h3" ($p.GetC "CIC" "Company Name") (tuple "fr" "CIC") }} - <p> - {{ $p.Get "Free coin rolls if you are a customer or €1 per roll if you are not a customer. There are coin roll machines." }} - </p> + <p> + {{ $p.Get "Free coin rolls if you are a customer or €1 per roll if you are not a customer. There are coin roll machines." }} + </p> - {{/* TRANSLATORS: Name of a bank */}} - {{ withTranslations "h3" + {{/* TRANSLATORS: Name of a bank */}} + {{ withTranslations "h3" ($p.GetC "Crédit Mutuel" "Company Name") (tuple "fr" "Crédit Mutuel") }} - <p> - {{ $p.Get "Free coin rolls if you are a customer or €1 per roll if you are not a customer. There are coin roll machines." }} - </p> + <p> + {{ $p.Get "Free coin rolls if you are a customer or €1 per roll if you are not a customer. There are coin roll machines." }} + </p> - {{/* TRANSLATORS: Name of a bank */}} - {{ withTranslations "h3" + {{/* TRANSLATORS: Name of a bank */}} + {{ withTranslations "h3" ($p.GetC "Crédit Agricole" "Company Name") (tuple "fr" "Crédit Agricole") }} - <p>{{ $p.Get "Coin rolls can be obtained with no fee. You must be a customer." }}</p> + <p>{{ $p.Get "Coin rolls can be obtained with no fee. You must be a customer." }}</p> - {{/* TRANSLATORS: Name of a bank */}} - {{ withTranslations "h3" + {{/* TRANSLATORS: Name of a bank */}} + {{ withTranslations "h3" ($p.GetC "LCL" "Company Name") (tuple "fr" "LCL") }} - <p> - {{ $p.Get "There are coin roll machines but it is not yet known if you need to be a customer or if there are fees." }} - </p> + <p> + {{ $p.Get "There are coin roll machines but it is not yet known if you need to be a customer or if there are fees." }} + </p> - {{ else if eq .Code "gr" }} + {{ else if eq $c.Code "gr" }} - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "Bank of Greece" "Company Name") (tuple "gr" "Τράπεζα της Ελλάδος") }} - <p> - {{ $p.Get "{EmphStart:r}NOTE{EmphEnd:E}: The Bank of Greece (Greece’s central bank) is NOT the same as the National Bank of Greece (a commercial bank)." - (map "EmphStart" `<strong>` "EmphEnd" "strong") | safe }} - </p> - <p> - {{ $p.Get "Coin rolls can be obtained with no fee, but you may need to present your ID. The latest commemorative coins are also sold for face value." }} - </p> - - {{ withTranslations "h3" + <p> + {{ $p.Get "{EmphStart:r}NOTE{EmphEnd:E}: The Bank of Greece (Greece’s central bank) is NOT the same as the National Bank of Greece (a commercial bank)." + (map "EmphStart" `<strong>` "EmphEnd" "strong") | safe }} + </p> + <p> + {{ $p.Get "Coin rolls can be obtained with no fee, but you may need to present your ID. The latest commemorative coins are also sold for face value." }} + </p> + + {{ withTranslations "h3" ($p.GetC "Piraeus Bank" "Company Name") (tuple "gr" "Τράπεζα Πειραιώς") }} - <p> - {{ $p.Get "Coin bags are available without fees for everyone. Smaller denominations are often not given out, and the coin bags you recieve are very large (there are reports of €1 bags containing 250 coins)." }} - </p> + <p> + {{ $p.Get "Coin bags are available without fees for everyone. Smaller denominations are often not given out, and the coin bags you recieve are very large (there are reports of €1 bags containing 250 coins)." }} + </p> - {{ else if eq .Code "hr" }} + {{ else if eq $c.Code "hr" }} - <p> - {{ $p.Get "We currently have no information regarding coin roll hunting in Croatia." }} - </p> + <p> + {{ $p.Get "We currently have no information regarding coin roll hunting in Croatia." }} + </p> - {{ else if eq .Code "ie" }} + {{ else if eq $c.Code "ie" }} - <p> - {{ $p.Get "In general, coin rolls are available at banks with a fee of €1 per roll; rolls could potentially have no fee if you only need a few." }} - </p> + <p> + {{ $p.Get "In general, coin rolls are available at banks with a fee of €1 per roll; rolls could potentially have no fee if you only need a few." }} + </p> - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "Central Bank of Ireland" "Company Name") (tuple "ga" "Banc Ceannais na hÉireann") (tuple "en" "Central Bank of Ireland") }} - <p>TODO</p> + <p>TODO</p> - {{ else if eq .Code "it" }} + {{ else if eq $c.Code "it" }} - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "Bank of Italy" "Company Name") (tuple "it" "Banca d’Italia") }} - <p> - {{ $p.Get "Coin rolls are available to everyone." }} - </p> + <p> + {{ $p.Get "Coin rolls are available to everyone." }} + </p> - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "Banca di Cambiano" "Company Name") (tuple "it" "Banca di Cambiano") }} - <p> - {{ $p.Get "There are coin roll machines but it is unknown if you need to be a customer or if there are additional fees." }} - </p> + <p> + {{ $p.Get "There are coin roll machines but it is unknown if you need to be a customer or if there are additional fees." }} + </p> - {{ else if eq .Code "lt" }} + {{ else if eq $c.Code "lt" }} - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "Bank of Lithuania" "Company Name") (tuple "en" "Lietuvos bankas") }} - <p> - {{ $p.Get "Allegedly, coin rolls are only available for businesses, but this needs additional confirmation." }} - </p> + <p> + {{ $p.Get "Allegedly, coin rolls are only available for businesses, but this needs additional confirmation." }} + </p> - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "ExchangeLT" "Company Name") (tuple "en" "ExchangeLT") }} - <p> - {{ $p.Get "Coin rolls are available with a fee of 5%." }} - </p> + <p> + {{ $p.Get "Coin rolls are available with a fee of 5%." }} + </p> - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "Top Exchange" "Company Name") (tuple "en" "Top Exchange") }} - <p> - {{ $p.Get "Fee of €2 per roll of 2 euro coins." }} - </p> + <p> + {{ $p.Get "Fee of €2 per roll of 2 euro coins." }} + </p> - {{ else if eq .Code "lu" }} + {{ else if eq $c.Code "lu" }} - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "Central Bank of Luxembourg" "Company Name") (tuple "lb" "Zentralbank vu Lëtzebuerg") (tuple "fr" "Banque centrale du Luxembourg") (tuple "de" "Luxemburger Zentralbank") }} - <p> - {{ $p.Get "We currently have no information regarding regular coins, however their webshop sells commemorative coins. Commemorative coins are also available for purchase in-person." }} - </p> + <p> + {{ $p.Get "We currently have no information regarding regular coins, however their webshop sells commemorative coins. Commemorative coins are also available for purchase in-person." }} + </p> - {{/* TRANSLATORS: Name of a bank */}} - {{ withTranslations "h3" + {{/* TRANSLATORS: Name of a bank */}} + {{ withTranslations "h3" ($p.GetC "Dexia" "Company Name") (tuple "fr" "Dexia") }} - <p> - {{ $p.Get "You should be able to get coin rolls with no additional fees." }} - </p> + <p> + {{ $p.Get "You should be able to get coin rolls with no additional fees." }} + </p> - {{ else if eq .Code "lv" }} + {{ else if eq $c.Code "lv" }} - <p> - {{ $p.Get "In general coin rolls are sold with for fee of €0.60 per roll, but we’re lacking a lot of information." }} - </p> + <p> + {{ $p.Get "In general coin rolls are sold with for fee of €0.60 per roll, but we’re lacking a lot of information." }} + </p> - {{ else if eq .Code "mc" }} + {{ else if eq $c.Code "mc" }} - <p> - {{ $p.Get "We currently have no information regarding coin roll hunting in Monaco." }} - </p> + <p> + {{ $p.Get "We currently have no information regarding coin roll hunting in Monaco." }} + </p> - {{ else if eq .Code "mt" }} + {{ else if eq $c.Code "mt" }} - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "Central Bank of Malta" "Company Name") (tuple "mt" "Bank Ċentrali ta’ Malta") }} - <p>TODO</p> + <p>TODO</p> - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "Bank of Valletta" "Company Name") (tuple "en" "Bank of Valletta") }} - <p> - {{ $p.Get "You can get rolls for a fee of €0.30 per roll. You must order coin rolls through their online platform, and you must be a customer." }} - </p> + <p> + {{ $p.Get "You can get rolls for a fee of €0.30 per roll. You must order coin rolls through their online platform, and you must be a customer." }} + </p> - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "HSBC Bank Malta" "Company Name") (tuple "en" "HSBC Bank Malta") }} - <p> - {{ $p.Get "You can get rolls for a fee of €0.30 per roll. You must order coin rolls through their online platform, and you must be a customer." }} - </p> + <p> + {{ $p.Get "You can get rolls for a fee of €0.30 per roll. You must order coin rolls through their online platform, and you must be a customer." }} + </p> - {{ else if eq .Code "nl" }} + {{ else if eq $c.Code "nl" }} - <p> - {{ $link := ifElse (eq $p.Language "nl") + <p> + {{ $link := ifElse (eq $p.Language "nl") "https://www.locatiewijzer.geldmaat.nl/nl" "https://www.locatiewijzer.geldmaat.nl/en" }} - {{ $p.Get "Banks in the Netherlands do not carry cash, and as such it’s not possible to obtain rolls from bank tellers. If you want to obtain coin rolls you need to use a Geldmaat coin roll machine which can be found in specific branches of GAMMA and Karwei. Geldmaat offers a map on their website where you can search for branches with these machines; you can find that map {Link:L}here{-:E}. Coin rolls are only available to customers of the banks listed below." - (map "Link" $link) | safe }} - </p> + {{ $p.Get "Banks in the Netherlands do not carry cash, and as such it’s not possible to obtain rolls from bank tellers. If you want to obtain coin rolls you need to use a Geldmaat coin roll machine which can be found in specific branches of GAMMA and Karwei. Geldmaat offers a map on their website where you can search for branches with these machines; you can find that map {Link:L}here{-:E}. Coin rolls are only available to customers of the banks listed below." + (map "Link" $link) | safe }} + </p> - <p> - {{ $p.Get "1- and 2 cent coins have been removed from circulation and cannot be obtained." }} - </p> + <p> + {{ $p.Get "1- and 2 cent coins have been removed from circulation and cannot be obtained." }} + </p> - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "The Dutch Central Bank" "Company Name") (tuple "nl" "De Nederlandsche Bank") }} - <p> - {{ $p.Get "Obtaining coins from the Dutch Central Bank is not possible." }} - </p> + <p> + {{ $p.Get "Obtaining coins from the Dutch Central Bank is not possible." }} + </p> - {{/* TRANSLATORS: Name of a bank */}} - {{ withTranslations "h3" + {{/* TRANSLATORS: Name of a bank */}} + {{ withTranslations "h3" ($p.GetC "ABN AMRO" "Company Name") (tuple "nl" "ABN AMRO") }} - <p> - {{ $p.Get "Coin rolls are available for a fee of €0.30 per roll. You must withdraw between 10–20 rolls." }} - </p> + <p> + {{ $p.Get "Coin rolls are available for a fee of €0.30 per roll. You must withdraw between 10–20 rolls." }} + </p> - {{/* TRANSLATORS: Name of a bank */}} - {{ withTranslations "h3" + {{/* TRANSLATORS: Name of a bank */}} + {{ withTranslations "h3" ($p.GetC "ING" "Company Name") (tuple "nl" "ING") }} - <p> - {{ $p.Get "Coin rolls are available for a fee of €7 + €0.35 per roll." }} - </p> + <p> + {{ $p.Get "Coin rolls are available for a fee of €7 + €0.35 per roll." }} + </p> - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "Rabobank" "Company Name") (tuple "nl" "Rabobank") }} - <p> - {{ $p.Get "Coin rolls are available for a fee of €7 + €0.50 per roll." }} - </p> + <p> + {{ $p.Get "Coin rolls are available for a fee of €7 + €0.50 per roll." }} + </p> - {{ else if eq .Code "pt" }} + {{ else if eq $c.Code "pt" }} - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "Bank of Portugal" "Company Name") (tuple "pt" "Banco de Portugal") }} - <p> - {{ $p.Get "Coin bags are sold with no additional fees to everyone." }} - </p> + <p> + {{ $p.Get "Coin bags are sold with no additional fees to everyone." }} + </p> - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "Banco Comercial Português" "Company Name") (tuple "pt" "Banco Comercial Português") }} - <p> - {{ $p.Get "Coin bags are sold with no additional fees to bank customers." }} - </p> + <p> + {{ $p.Get "Coin bags are sold with no additional fees to bank customers." }} + </p> - {{ else if eq .Code "si" }} + {{ else if eq $c.Code "si" }} - <p> - {{ $p.Get "In general there is a €1.20 fee for coin rolls." }} - </p> + <p> + {{ $p.Get "In general there is a €1.20 fee for coin rolls." }} + </p> - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "Bank of Slovenia" "Company Name") (tuple "sl" "Banka Slovenije") }} - <p> - {{ $p.Get "You can purchase commemorative coins for face value, and coin rolls are sold with no fees to everyone." }} - </p> + <p> + {{ $p.Get "You can purchase commemorative coins for face value, and coin rolls are sold with no fees to everyone." }} + </p> - {{ else if eq .Code "sk" }} + {{ else if eq $c.Code "sk" }} - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "National Bank of Slovakia" "Company Name") (tuple "sk" "Národná banka Slovenska") }} - <p> - {{ $p.Get "You may be able to get uncirculated rolls, but this is not yet confirmed." }} - </p> + <p> + {{ $p.Get "You may be able to get uncirculated rolls, but this is not yet confirmed." }} + </p> - {{ withTranslations "h3" + {{ withTranslations "h3" ($p.GetC "Tatra banka" "Company Name") (tuple "sk" "Tatra banka") }} - <p> - {{ $p.Get "You can get an unlimited number of rolls for a €5 fee. You must be a customer of the bank." }} - </p> + <p> + {{ $p.Get "You can get an unlimited number of rolls for a €5 fee. You must be a customer of the bank." }} + </p> - {{ else if eq .Code "sm" }} + {{ else if eq $c.Code "sm" }} - <p> - {{ $p.Get "We currently have no information regarding coin roll hunting in San Marino." }} - </p> + <p> + {{ $p.Get "We currently have no information regarding coin roll hunting in San Marino." }} + </p> - {{ else if eq .Code "va" }} + {{ else if eq $c.Code "va" }} - <p> - {{ $p.Get "Ask the Pope nicely and he’ll probably give you some Vatican coins for free." }} - </p> + <p> + {{ $p.Get "Ask the Pope nicely and he’ll probably give you some Vatican coins for free." }} + </p> + {{ end }} + </details> + {{ if ne (plus1 $i) (len $countries) }} + <hr> {{ end }} - </details> - {{ end }} + {{ end }} + </article> </main> {{ end }}
\ No newline at end of file diff --git a/src/templates/collecting.html.tmpl b/src/templates/collecting.html.tmpl index 676f55b..d8ecf18 100644 --- a/src/templates/collecting.html.tmpl +++ b/src/templates/collecting.html.tmpl @@ -1,63 +1,61 @@ {{ define "header" }} {{ template "header-navbar" . }} + +<style> + #sections { + --button-min-width: 40ch; + + article { + min-height: 100%; + } + } +</style> {{ end }} {{ define "content" }} -<header> +<header class="container"> {{ template "navbar" . }} <h1>{{ .Get "Euro Coin Collecting" }}</h1> </header> -<main> +<main class="container"> <p> {{ .Get "On this section of the site you can find everything there is to know about collecting Euro coins. If this is a hobby that interests you, join the Discord server linked at the top of the page!" }} </p> <hr> - <section> - <div class="grid"> - <a class="no-deco" href="/collecting/crh"> - <article> - <header> - <h3>{{ .Get "Coin Roll Hunting" }}</h3> - </header> - <main> - {{ .Get "Learn about collecting coins from coin rolls" }} - </main> - </article> - </a> - <a class="no-deco" href="/collecting/storage"> - <article> - <header> - <h3>{{ .Get "Coin Storage" }}</h3> - </header> - <main> - {{ .Get "Learn about the different methods to storing your collection" }} - </main> - </article> - </a> - <!-- TODO: Implement the shop hunting page --> - <a class="no-deco" href="#"> - <article> - <header> - <h3>{{ .Get "Shop Hunting" }}</h3> - </header> - <main> - {{ .Get "Learn about how to collect coins from shops" }} - </main> - </article> - </a> - </div> - <div class="grid"> - <a class="no-deco" href="/collecting/vending"> - <article> - <header> - <h3>{{ .Get "Vending Machine Hunting" }}</h3> - </header> - <main> - {{ .Get "Learn about collecting coins from vending machines" }} - </main> - </article> - </a> - </div> - </section> + <div id="sections" class="button-grid"> + <a class="no-deco" href="/collecting/crh"> + <article> + <header> + <h3>{{ .Get "Coin Roll Hunting" }}</h3> + </header> + {{ .Get "Learn about collecting coins from coin rolls" }} + </article> + </a> + <a class="no-deco" href="/collecting/storage"> + <article> + <header> + <h3>{{ .Get "Coin Storage" }}</h3> + </header> + {{ .Get "Learn about the different methods to storing your collection" }} + </article> + </a> + <!-- TODO: Implement the shop hunting page --> + <a class="no-deco" href="#"> + <article> + <header> + <h3>{{ .Get "Shop Hunting" }}</h3> + </header> + {{ .Get "Learn about how to collect coins from shops" }} + </article> + </a> + <a class="no-deco" href="/collecting/vending"> + <article> + <header> + <h3>{{ .Get "Vending Machine Hunting" }}</h3> + </header> + {{ .Get "Learn about collecting coins from vending machines" }} + </article> + </a> + </div> </main> {{ end }}
\ No newline at end of file diff --git a/src/templates/index.html.tmpl b/src/templates/index.html.tmpl index 4091ef6..d560c64 100644 --- a/src/templates/index.html.tmpl +++ b/src/templates/index.html.tmpl @@ -3,7 +3,7 @@ {{ end }} {{ define "content" }} -<header> +<header class="container"> {{ template "navbar" . }} <hgroup> <h1>{{ .Get "The Euro Cash Wiki" }}</h1> @@ -16,7 +16,7 @@ </p> </hgroup> </header> -<main> +<main class="container"> <!-- TODO(2026): s/26/27/; Welcome Bulgaria! --> <p> {{ .Get "Welcome to the Euro Cash Wiki! This sites aims to be a resource for you to discover everything there is to know about the coins and banknotes of the Euro, a currency that spans 26 countries and 350 million people. We also have dedicated sections of the site for collectors." }} diff --git a/src/templates/jargon.html.tmpl b/src/templates/jargon.html.tmpl index f73ed5f..593a169 100644 --- a/src/templates/jargon.html.tmpl +++ b/src/templates/jargon.html.tmpl @@ -1,13 +1,20 @@ {{ define "header" }} {{ template "header-navbar" . }} + +<style> + dt > a:target { + background-color: var(--pico-mark-background-color); + } +</style> {{ end }} + {{ define "content" }} -<header> +<header class="container"> {{ template "navbar" . }} <h1>{{ .Get "Euro Cash Jargon" }}</h1> </header> -<main> +<main class="container"> <p> {{ .Get "Both on this website and in other related forums you will come across many terms that you may not be familiar with. This page will hopefully get you up to speed with the most important and frequently-used terminology." }} </p> diff --git a/src/templates/language.html.tmpl b/src/templates/language.html.tmpl index 21cd49d..c3bfa94 100644 --- a/src/templates/language.html.tmpl +++ b/src/templates/language.html.tmpl @@ -22,7 +22,7 @@ > :first-child { font-size: 2em; font-weight: 600; /* Between normal and bold */ - min-width: calc(var(--form-element-spacing-horizontal) + 2ch); + min-width: calc(var(--pico-form-element-spacing-horizontal) + 2ch); } } } @@ -73,14 +73,14 @@ {{ end }} {{ define "content" }} -<header> +<header class="container"> {{ template "navbar" . }} <h1> {{ .Get "Select Your Language" }} <br><span class="lang-fade-in-out translation"> </span> </h1> </header> -<main> +<main class="container"> <h2> {{ .Get "Eurozone Languages" }} <br><span class="lang-fade-in-out translation"> </span> |