summaryrefslogtreecommitdiffhomepage
path: root/src/templates/coins-mintages.html.tmpl
blob: 4ac29e8b0f74f166a1457eb329a55f169a48c945 (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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
{{ define "content" }}
<header>
	{{ template "navbar" . }}
	<h1>{{ .T "Euro Coin Mintages" }}</h1>
</header>
<main>
	<p>
		{{ .T `
			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>{{ .T "Additional Notes" }}</h2>
		<ul>
			<li>
				{{ .T `
					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, %sclick here%s.`
					`<a href="#TODO">` `</a>` | safe
				}}
			</li>
			<li>
				{{ .T `
					In 2003 Numista calculated a total of %d coins issued for coin
					sets per denomination.  Our own calculations found only
					%d.  Numista also forgot to include the many hundred thousand
					coins from the coin roll sets that were produced.`
					217503 177003
				}}
			</li>
		</ul>
	{{ end }}
	<section>
		<form>
			<div class="grid">
				<label for="country-dd">
					{{ .T "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" (.T "Circulation Coins")) }}
					{{ template "coin-type-radio"
					   (tuple .Type "nifc" (.T "NIFC / BU Sets")) }}
					{{ template "coin-type-radio"
					   (tuple .Type "proof" (.T "Proof Coins")) }}
				</fieldset>
			</div>
			<button type="submit">{{ .T "Filter" }}</button>
		</form>
		<figure>
			<figcaption>{{ .T "Standard Issue Coins" }}</figcaption>
			<table class="mintage-table" role="grid">
				<thead>
					<th>{{ .T "Year" }}</th>
					{{ with $p := .Printer }}
						{{ range denoms }}
							<th>{{ $p.M . false }}</th>
						{{ end }}
					{{ end }}
				</thead>
				<tbody>
					{{ $p := .Printer }}
					{{ $type := .Type }}
					{{ range .Mintages.Standard }}
						<tr>
							<th scope="col">
								{{- .Year -}}
								{{- if ne .Mintmark "" -}}
									&nbsp;<sub><small>{{ .Mintmark }}</small></sub>
								{{- end -}}
							</th>
							{{ range (index .Mintages (strToCtype $type)) }}
								{{ if eq . -1 }}
									<td>{{ $p.T "Unknown" }}</td>
								{{ else if eq . 0 }}
									<td>—</td>
								{{ else }}
									<td>{{ $p.N . }}</td>
								{{ end }}
								</td>
							{{ end }}
						</tr>
					{{ end }}
				</tbody>
			</table>
		</figure>
		{{ if ne (len .Mintages.Commemorative) 0 }}
			<figure>
				<figcaption>{{ .T "Commemorative Coins" }}</figcaption>
				<table class="mintage-table-cc" role="grid">
					<thead>
						<th>{{ .T "Year" }}</th>
						<th>{{ .T "Commemorated Issue" }}</th>
						<th>{{ .T "Mintage" }}</th>
					</thead>
					<tbody>
						{{ $p := .Printer }}
						{{ $type := .Type }}
						{{ 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 (index .Mintage (strToCtype $type)) }}
									{{ if eq . -1 }}
										<td>{{ $p.T "Unknown" }}</td>
									{{ else if eq . 0 }}
										<td>—</td>
									{{ else }}
										<td>{{ $p.N . }}</td>
									{{ end }}
								{{ end }}
							</tr>
						{{ end }}
					</tbody>
				</table>
			</figure>
		{{ end }}
	</section>
</main>
{{ end }}

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