tooltip component

This commit is contained in:
2026-01-29 18:52:54 -07:00
parent 9ae8745b12
commit 12ba219ef9
4 changed files with 167 additions and 8 deletions
+18 -1
View File
@@ -4,11 +4,11 @@ import (
"encoding/json"
"errors"
"fmt"
"html/template"
"net/http"
"net/url"
"strconv"
"strings"
"text/template"
"ruben/inventory2/internal/domains/accounts"
etsy_platform "ruben/inventory2/internal/domains/platforms/etsy"
@@ -81,6 +81,11 @@ func Routes(
return a * b
},
// html
"rawHTML": func(s string) template.HTML {
return template.HTML(s)
},
// json
"prettyPrintJSON": func(j json.RawMessage) string {
b, err := json.MarshalIndent(j, " ", "")
@@ -90,6 +95,18 @@ func Routes(
return string(b)
},
"marshalJSON": json.Marshal,
// slices
"newSlice": func(args ...any) []any {
return args
},
"newHTMLSlice": func(args ...string) []template.HTML {
ss := make([]template.HTML, len(args))
for i, s := range args {
ss[i] = template.HTML(s)
}
return ss
},
}
},
}),