fix: no proper loading feedback on forms

This commit is contained in:
juancwu 2026-02-14 23:12:43 +00:00
commit d224f5a10a
27 changed files with 192 additions and 57 deletions

View file

@ -56,6 +56,8 @@ templ Base(props ...SEOProps) {
@smoothScrollScript()
// HTMX CSRF configuration
@htmxCSRFScript()
// Form submit spinner for non-HTMX forms
@formSubmitScript()
// Google Analytics
if cfg := ctxkeys.Config(ctx); cfg != nil && cfg.GoogleMeasuringID != "" {
@googleAnalyticsScript(cfg.GoogleMeasuringID)
@ -118,6 +120,10 @@ templ htmxCSRFScript() {
<script src="/assets/js/htmx-csrf.js"></script>
}
templ formSubmitScript() {
<script src="/assets/js/form-submit.js"></script>
}
templ googleAnalyticsScript(id string) {
<script async src={ "https://www.googletagmanager.com/gtag/js?id=" + id }></script>
<script type="text/javascript">