summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--main.go9
-rw-r--r--templates/coins_designs.templ63
2 files changed, 68 insertions, 4 deletions
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 = `<a href="/coins/varieties">`
+
+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")},
+ }
+ }}
+ <header>
+ @navbar()
+ <h1>{ p.T("Euro Coin Designs") }</h1>
+ </header>
+ <main>
+ <p>
+ @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))
+ </p>
+ <hr/>
+ <div class="country-grid">
+ for _, c := range countries {
+ <a
+ role="button"
+ class="outline"
+ data-code={ c.Code }
+ href="#TODO"
+ >
+ { p.T(c.Name) }
+ </a>
+ }
+ </div>
+ </main>
+}