summaryrefslogtreecommitdiffhomepage
path: root/template/coins_mintages.templ
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-08-11 22:33:34 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-08-11 22:33:34 +0200
commit574fd098228f5b63d10a4a739ee7b8e6c668a671 (patch)
tree171ec68e046af60af0861ac42eeb6dc54138f7e7 /template/coins_mintages.templ
parenta0c502e3a1490e5b69bb550f2fb4f79fadfa34b7 (diff)
More work on mintages
Diffstat (limited to 'template/coins_mintages.templ')
-rw-r--r--template/coins_mintages.templ34
1 files changed, 19 insertions, 15 deletions
diff --git a/template/coins_mintages.templ b/template/coins_mintages.templ
index b6ed2de..47940e1 100644
--- a/template/coins_mintages.templ
+++ b/template/coins_mintages.templ
@@ -17,7 +17,7 @@ var denoms = [...]float64{
templ CoinsMintages() {
{{
code := ctx.Value("code").(string)
- set := ctx.Value("set").(mintage.Set)
+ table := ctx.Value("table").([]mintage.Row)
p := ctx.Value("printer").(lib.Printer)
}}
<header>
@@ -45,7 +45,7 @@ templ CoinsMintages() {
<div class="grid">
<label for="country-dd">
{ p.T("Country") }
- <select id="country-dd" name="c">
+ <select id="country-dd" name="code">
for _, c := range ctx.Value("countries").
([]lib.Country) {
<option
@@ -58,18 +58,9 @@ templ CoinsMintages() {
</select>
</label>
<fieldset>
- <label for="compact-circ">
- <input id="compact-circ" type="checkbox" name="circ" checked/>
- { p.T("Circulation Coins") }
- </label>
- <label for="compact-nifc">
- <input id="compact-nifc" type="checkbox" name="nifc"/>
- { p.T("NIFC / BU Sets") }
- </label>
- <label for="compact-proof">
- <input id="compact-proof" type="checkbox" name="proof"/>
- { p.T("Proof Coins") }
- </label>
+ @coinTypeRadio("circ", p.T("Circulation Coins"))
+ @coinTypeRadio("nifc", p.T("NIFC / BU Sets"))
+ @coinTypeRadio("proof", p.T("Proof Coins"))
</fieldset>
</div>
<button type="submit">{ p.T("Filter") }</button>
@@ -83,7 +74,7 @@ templ CoinsMintages() {
}
</thead>
<tbody>
- for _, row := range set.Circ {
+ for _, row := range table {
<tr>
<th scope="col">
if row.Mintmark != "" {
@@ -110,3 +101,16 @@ templ CoinsMintages() {
</section>
</main>
}
+
+templ coinTypeRadio(short, long string) {
+ <label for={ "compact-" + short }>
+ <input
+ id={ "compact-" + short }
+ type="radio"
+ name="type"
+ value={ short }
+ checked?={ ctx.Value("type").(string) == short }
+ />
+ { long }
+ </label>
+}