Added ogent for entity code gen.

This commit is contained in:
mikestefanello 2025-04-01 10:20:14 -04:00
parent 9a92c4aad6
commit 196d34cc1f
29 changed files with 13445 additions and 12 deletions

View file

@ -10,6 +10,13 @@ import (
)
func JS(r *ui.Request) Node {
return Group{
Script(Src("https://unpkg.com/htmx.org@2.0.0/dist/htmx.min.js")),
Script(Src("https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"), Defer()),
}
}
func HtmxListeners(r *ui.Request) Node {
const htmxErr = `
document.body.addEventListener('htmx:beforeSwap', function(evt) {
if (evt.detail.xhr.status >= 400){
@ -28,8 +35,6 @@ func JS(r *ui.Request) Node {
`
return Group{
Script(Src("https://unpkg.com/htmx.org@2.0.0/dist/htmx.min.js")),
Script(Src("https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"), Defer()),
Script(Raw(htmxErr)),
Iff(len(r.CSRF) > 0, func() Node {
return Script(Raw(fmt.Sprintf(htmxCSRF, r.CSRF)))