add and refine thunderball results page

This commit is contained in:
2025-03-25 14:47:41 +00:00
parent f1ad9757ba
commit 0b93fd75dd
12 changed files with 375 additions and 28 deletions

25
helpers/template.go Normal file
View File

@@ -0,0 +1,25 @@
package helpers
import (
"html/template"
)
func TemplateFuncs() template.FuncMap {
return template.FuncMap{
"plus1": func(i int) int { return i + 1 },
"minus1": func(i int) int {
if i > 1 {
return i - 1
}
return 0
},
"mul": func(a, b int) int { return a * b },
"add": func(a, b int) int { return a + b },
"min": func(a, b int) int {
if a < b {
return a
}
return b
},
}
}