changing some things for reports section
This commit is contained in:
@@ -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{}) {
|
||||
|
||||
Reference in New Issue
Block a user