diff options
Diffstat (limited to 'src/templates.go')
-rw-r--r-- | src/templates.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/templates.go b/src/templates.go index 076f8dc..6a43fcb 100644 --- a/src/templates.go +++ b/src/templates.go @@ -10,7 +10,6 @@ import ( . "git.thomasvoss.com/euro-cash.eu/pkg/try" "git.thomasvoss.com/euro-cash.eu/pkg/watch" - "git.thomasvoss.com/euro-cash.eu/src/dbx" "git.thomasvoss.com/euro-cash.eu/src/i18n" ) @@ -20,8 +19,8 @@ type templateData struct { Printers map[string]i18n.Printer Code, Type, FilterBy string Year int - CountryMintages dbx.CountryMintageData - YearMintages dbx.YearMintageData + CountryMintages CountryMintageTable + YearMintages YearMintageTable Countries []country } @@ -30,6 +29,7 @@ var ( errorTmpl *template.Template templates map[string]*template.Template funcmap = map[string]any{ + "evenp": evenp, "ifElse": ifElse, "locales": i18n.Locales, "map": templateMakeMap, @@ -132,6 +132,10 @@ func templateMakeMap(args ...any) map[string]any { return m } +func evenp(n int) bool { + return n&1 == 0 +} + func ifElse(b bool, x, y any) any { if b { return x |