From 344be01d24d47a3c7cab78ae76bb530250020aa5 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Thu, 8 Aug 2024 13:55:36 +0200 Subject: Add /coins/designs --- main.go | 9 ++++--- templates/coins_designs.templ | 63 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 templates/coins_designs.templ diff --git a/main.go b/main.go index 244a0ac..17c2253 100644 --- a/main.go +++ b/main.go @@ -18,10 +18,11 @@ import ( ) var components = map[string]templ.Component{ - "/": templates.Index(), - "/about": templates.About(), - "/coins": templates.CoinsIndex(), - "/language": templates.Language(), + "/": templates.Index(), + "/about": templates.About(), + "/coins": templates.CoinsIndex(), + "/coins/designs": templates.CoinsDesigns(), + "/language": templates.Language(), } func main() { diff --git a/templates/coins_designs.templ b/templates/coins_designs.templ new file mode 100644 index 0000000..61fdc5c --- /dev/null +++ b/templates/coins_designs.templ @@ -0,0 +1,63 @@ +package templates + +import "git.thomasvoss.com/euro-cash.eu/i18n" + +type country struct { + Code, Name string +} + +var varietiesLinkStart = `` + +templ CoinsDesigns() { + {{ + p := ctx.Value("printer").(i18n.Printer) + countries := []country{ + {Code: "AD", Name: p.T("Andorra")}, + {Code: "AT", Name: p.T("Austria")}, + {Code: "BE", Name: p.T("Belgium")}, + {Code: "CY", Name: p.T("Cyprus")}, + {Code: "DE", Name: p.T("Germany")}, + {Code: "EE", Name: p.T("Estonia")}, + {Code: "ES", Name: p.T("Spain")}, + {Code: "FI", Name: p.T("Finland")}, + {Code: "FR", Name: p.T("France")}, + {Code: "GR", Name: p.T("Greece")}, + {Code: "HR", Name: p.T("Croatia")}, + {Code: "IE", Name: p.T("Ireland")}, + {Code: "IT", Name: p.T("Italy")}, + {Code: "LT", Name: p.T("Lithuania")}, + {Code: "LU", Name: p.T("Luxembourg")}, + {Code: "LV", Name: p.T("Latvia")}, + {Code: "MC", Name: p.T("Monaco")}, + {Code: "MT", Name: p.T("Malta")}, + {Code: "NL", Name: p.T("Netherlands")}, + {Code: "PT", Name: p.T("Portugal")}, + {Code: "SI", Name: p.T("Slovenia")}, + {Code: "SK", Name: p.T("Slovakia")}, + {Code: "SM", Name: p.T("San Marino")}, + {Code: "VA", Name: p.T("Vatican City")}, + } + }} +
+ @navbar() +

{ p.T("Euro Coin Designs") }

+
+
+

+ @templ.Raw(p.T("Here you’ll be able to view all the coin designs for each country in the Eurozone. This section of the site doesn’t include minor varieties such as different mintmarks or errors; those are on the %svarieties%s page.", varietiesLinkStart, linkEnd)) +

+
+
+
+} -- cgit v1.2.3