tooltip component
This commit is contained in:
@@ -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
|
||||
},
|
||||
}
|
||||
},
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user