aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/templates/coins-mintages.html.tmpl
blob: 8df086874c5d40ef45fe815cc44d25784b47d3f3 (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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
{{ define "content" }}
<header>
	{{ template "navbar" . }}
	<h1>{{ .Get "Euro Coin Mintages" }}</h1>
</header>
<main>
	<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 />
	{{ 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}."
				(map "Link" "#TODO") }}
			</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 class="mintage-table" role="grid">
				<thead>
					<th>{{ .Get "Year" }}</th>
					<th>{{ .Printer.Sprintf "{N:m}" (map "N" 0.01) }}</th>
					<th>{{ .Printer.Sprintf "{N:m}" (map "N" 0.02) }}</th>
					<th>{{ .Printer.Sprintf "{N:m}" (map "N" 0.05) }}</th>
					<th>{{ .Printer.Sprintf "{N:m}" (map "N" 0.10) }}</th>
					<th>{{ .Printer.Sprintf "{N:m}" (map "N" 0.20) }}</th>
					<th>{{ .Printer.Sprintf "{N:m}" (map "N" 0.50) }}</th>
					<th>{{ .Printer.Sprintf "{N:m}" (map "N" 1.00) }}</th>
					<th>{{ .Printer.Sprintf "{N:m}" (map "N" 2.00) }}</th>
				</thead>
				<tbody>
					{{ $p := .Printer }}
					{{ range .Mintages.Standard }}
						<tr>
							<th scope="col">
								{{- .Year -}}
								{{- if ne .Mintmark "" -}}
									&nbsp;<sub><small>{{ .Mintmark }}</small></sub>
								{{- end -}}
							</th>
							{{ range .Mintages }}
								{{ if eq . -1 }}
									<td>{{ $p.Get "Unknown" }}</td>
								{{ else if eq . -2 }}
									<td class="error">{{ $p.Get "Error" }}</td>
								{{ else if eq . 0 }}
									<td>—</td>
								{{ else }}
									<td>{{ $p.Sprintf "{N}" (map "N" .) }}</td>
								{{ end }}
								</td>
							{{ end }}
						</tr>
					{{ end }}
				</tbody>
			</table>
		</figure>
		{{ if ne (len .Mintages.Commemorative) 0 }}
			<figure>
				<figcaption>{{ .Get "Commemorative Coins" }}</figcaption>
				<table class="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 "" -}}
										&nbsp;<sub><small>{{ .Mintmark }}</small></sub>
									{{- end -}}
								</th>
								<!-- TODO: Translate commemorative names -->
								<td>{{ .Name }}</td>
								{{ with .Mintage }}
									{{ if eq . -1 }}
										<td>{{ $p.Get "Unknown" }}</td>
									{{ else if eq . -2 }}
										<td class="error">{{ $p.Get "Error" }}</td>
									{{ else if eq . 0 }}
										<td>—</td>
									{{ else }}
										<td>{{ $p.Sprintf "{N}" (map "N" .) }}</td>
									{{ end }}
								{{ end }}
							</tr>
						{{ end }}
					</tbody>
				</table>
			</figure>
		{{ end }}
	</section>
</main>
{{ end }}

{{ define "coin-type-radio" }}
<label for="{{ index . 1 }}">
	<input
		id="{{ index . 1 }}"
		name="type"
		type="radio"
		value="{{ index . 1 }}"
		{{ if eq (index . 0) (index . 1) }}
			checked
		{{ end }}
	/>
	{{ index . 2 }}
</label>
{{ end }}