diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/coins_designs_templ.go | 136 | ||||
-rw-r--r-- | templates/coins_index_templ.go | 147 | ||||
-rw-r--r-- | templates/language.templ | 4 | ||||
-rw-r--r-- | templates/language_templ.go | 8 | ||||
-rw-r--r-- | templates/root.templ | 2 | ||||
-rw-r--r-- | templates/root_templ.go | 6 |
6 files changed, 293 insertions, 10 deletions
diff --git a/templates/coins_designs_templ.go b/templates/coins_designs_templ.go new file mode 100644 index 0000000..c826541 --- /dev/null +++ b/templates/coins_designs_templ.go @@ -0,0 +1,136 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.747 +package templates + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import "git.thomasvoss.com/euro-cash.eu/i18n" + +type country struct { + Code, Name string +} + +var varietiesLinkStart = `<a href="/coins/varieties">` + +func CoinsDesigns() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + + 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")}, + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<header>") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = navbar().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<h1>") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var2 string + templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(p.T("Euro Coin Designs")) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `coins_designs.templ`, Line: 43, Col: 32} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</h1></header><main><p>") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = 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)).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</p><hr><div class=\"country-grid\">") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + for _, c := range countries { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a role=\"button\" class=\"outline\" data-code=\"") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var3 string + templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(c.Code) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `coins_designs.templ`, Line: 55, Col: 23} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" href=\"#TODO\">") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var4 string + templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(p.T(c.Name)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `coins_designs.templ`, Line: 58, Col: 18} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</a>") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></main>") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} diff --git a/templates/coins_index_templ.go b/templates/coins_index_templ.go new file mode 100644 index 0000000..ad40c1e --- /dev/null +++ b/templates/coins_index_templ.go @@ -0,0 +1,147 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.747 +package templates + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import "git.thomasvoss.com/euro-cash.eu/i18n" + +const newsLinkStart = `<a href="/news">` + +func CoinsIndex() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + p := ctx.Value("printer").(i18n.Printer) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<header>") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = navbar().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<h1>") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var2 string + templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(p.T("Euro Coins")) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `coins_index.templ`, Line: 11, Col: 25} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</h1></header><main><p>") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ.Raw(p.T("On this section of the site you can find everything there is to know about the coins of the Eurozone. For the latest news on coin- and design releases, check out the %snews%s tab!", newsLinkStart, linkEnd)).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</p><hr><section><div class=\"grid\"><a class=\"no-deco\" href=\"/coins/designs\"><article><header><h3>") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var3 string + templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(p.T("Designs")) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `coins_index.templ`, Line: 23, Col: 27} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</h3></header><main>") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var4 string + templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(p.T("View the 600+ different Euro-coin designs!")) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `coins_index.templ`, Line: 26, Col: 58} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</main></article></a> <a class=\"no-deco\" href=\"#TODO\"><article><header><h3>") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var5 string + templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(p.T("Mintages")) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `coins_index.templ`, Line: 33, Col: 28} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</h3></header><main>") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var6 string + templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(p.T("View the mintage figures of all the Euro coins!")) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `coins_index.templ`, Line: 36, Col: 63} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</main></article></a> <a class=\"no-deco\" href=\"#TODO\"><article><header><h3>") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var7 string + templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(p.T("Varieties")) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `coins_index.templ`, Line: 43, Col: 29} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</h3></header><main>") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var8 string + templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(p.T("View all the known Euro varieties!")) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `coins_index.templ`, Line: 46, Col: 50} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</main></article></a></div></section></main>") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} diff --git a/templates/language.templ b/templates/language.templ index ba8db78..58dc8b6 100644 --- a/templates/language.templ +++ b/templates/language.templ @@ -37,11 +37,11 @@ templ languageGrid(eurozone bool) { <button type="submit" name="locale" - value={ loc.Code } + value={ loc.Bcp } disabled?={ !loc.Enabled } > <span - lang={ loc.Code } + lang={ loc.Bcp } data-code={ strings.ToUpper(loc.Language()) } > { loc.Name } diff --git a/templates/language_templ.go b/templates/language_templ.go index 6842b99..6d7182c 100644 --- a/templates/language_templ.go +++ b/templates/language_templ.go @@ -146,9 +146,9 @@ func languageGrid(eurozone bool) templ.Component { return templ_7745c5c3_Err } var templ_7745c5c3_Var7 string - templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(loc.Code) + templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(loc.Bcp) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `language.templ`, Line: 40, Col: 22} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `language.templ`, Line: 40, Col: 21} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) if templ_7745c5c3_Err != nil { @@ -169,9 +169,9 @@ func languageGrid(eurozone bool) templ.Component { return templ_7745c5c3_Err } var templ_7745c5c3_Var8 string - templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(loc.Code) + templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(loc.Bcp) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `language.templ`, Line: 44, Col: 22} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `language.templ`, Line: 44, Col: 21} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) if templ_7745c5c3_Err != nil { diff --git a/templates/root.templ b/templates/root.templ index 80b4a95..f4fd0e2 100644 --- a/templates/root.templ +++ b/templates/root.templ @@ -5,7 +5,7 @@ import "git.thomasvoss.com/euro-cash.eu/i18n" templ Root(head, body templ.Component) { {{ p := ctx.Value("printer").(i18n.Printer) }} <!DOCTYPE html> - <html lang={ p.Locale.Code } data-theme={ ctx.Value("theme").(string) }> + <html lang={ p.Locale.Bcp } data-theme={ ctx.Value("theme").(string) }> <head> <meta charset="UTF-8"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> diff --git a/templates/root_templ.go b/templates/root_templ.go index dbb6345..895e404 100644 --- a/templates/root_templ.go +++ b/templates/root_templ.go @@ -34,9 +34,9 @@ func Root(head, body templ.Component) templ.Component { return templ_7745c5c3_Err } var templ_7745c5c3_Var2 string - templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(p.Locale.Code) + templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(p.Locale.Bcp) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `root.templ`, Line: 8, Col: 27} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `root.templ`, Line: 8, Col: 26} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { @@ -49,7 +49,7 @@ func Root(head, body templ.Component) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(ctx.Value("theme").(string)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `root.templ`, Line: 8, Col: 70} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `root.templ`, Line: 8, Col: 69} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { |