changing some things for reports section

This commit is contained in:
Mann Patel
2025-09-01 17:32:00 -06:00
parent e071ced77f
commit 76744e81cb
16 changed files with 411461 additions and 1587 deletions

View File

@@ -7,6 +7,7 @@ import (
"net/http"
"os"
"path/filepath"
"strings"
"github.com/joho/godotenv"
)
@@ -45,6 +46,17 @@ var templateFuncs = template.FuncMap{
}
return pages
},
"formatColumnName": func(name string) string {
// Replace underscores with spaces and title case each word
formatted := strings.ReplaceAll(name, "_", " ")
words := strings.Fields(formatted)
for i, word := range words {
if len(word) > 0 {
words[i] = strings.ToUpper(string(word[0])) + strings.ToLower(word[1:])
}
}
return strings.Join(words, " ")
},
}
func Render(w http.ResponseWriter, tmpl string, data interface{}) {