summaryrefslogtreecommitdiffhomepage
path: root/templates/coins_designs.templ
blob: 645d0cf764970e51339b4fa4e8dc57afc9c18d69 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package templates

import (
	"fmt"
	"strings"

	"git.thomasvoss.com/euro-cash.eu/i18n"
)

type country struct {
	code, name string
}

var varietiesLinkStart = `<a href="/coins/varieties">`

func makeURL(c country) templ.SafeURL {
	url := fmt.Sprintf("/coins/designs/%s", strings.ToLower(c.code))
	return templ.SafeURL(url)
}

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={ makeURL(c) }
				>
					{ p.T(c.name) }
				</a>
			}
		</div>
	</main>
}