summaryrefslogtreecommitdiffhomepage
path: root/templates/coins_designs.templ
blob: 4732ab046b115f6dedbd54d19f5aba2a857866f2 (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
package templates

import (
	"fmt"
	"strings"

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

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) }}
	<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(p, sortByName) {
				<a
					role="button"
					class="outline"
					data-code={ c.code }
					href={ makeURL(c) }
				>
					{ p.T(c.name) }
				</a>
			}
		</div>
	</main>
}