Monorepo for Tangled tangled.org
2

Configure Feed

Select the types of activity you want to include in your feed.

appview: clear signup error message on successful signup

Signed-off-by: nove-b <nove.b.web@gmail.com>

author
nove-b
committer
Tangled
date (May 24, 2026, 2:55 PM +0300) commit 249b32e8 parent 5ee1a042
+15 -2
+13
appview/pages/htmx.go
··· 4 4 "fmt" 5 5 "html" 6 6 "net/http" 7 + "strings" 7 8 ) 8 9 9 10 // Notice performs a hx-oob-swap to replace the content of an element with a message. ··· 23 24 w.Header().Set("Content-Type", "text/html") 24 25 w.WriteHeader(http.StatusOK) 25 26 w.Write([]byte(markup)) 27 + } 28 + 29 + func (s *Pages) NoticeHTMLWithClears(w http.ResponseWriter, id string, trustedHTML string, clearIDs ...string) { 30 + var b strings.Builder 31 + b.WriteString(fmt.Sprintf(`<span id="%s" hx-swap-oob="innerHTML">%s</span>`, id, trustedHTML)) 32 + for _, clearID := range clearIDs { 33 + b.WriteString(fmt.Sprintf(`<span id="%s" hx-swap-oob="innerHTML"></span>`, clearID)) 34 + } 35 + 36 + w.Header().Set("Content-Type", "text/html") 37 + w.WriteHeader(http.StatusOK) 38 + w.Write([]byte(b.String())) 26 39 } 27 40 28 41 // HxRefresh is a client-side full refresh of the page.
+2 -2
appview/signup/signup.go
··· 332 332 // if we get here, we've successfully created the account and added the email 333 333 success = true 334 334 335 - s.pages.NoticeHTML(w, "signup-msg", fmt.Sprintf(`Account created successfully. You can now 335 + s.pages.NoticeHTMLWithClears(w, "signup-msg", fmt.Sprintf(`Account created successfully. You can now 336 336 <a class="underline text-black dark:text-white" href="/login">login</a> 337 - with <code>%s.tngl.sh</code>.`, username)) 337 + with <code>%s.tngl.sh</code>.`, username), "signup-error") 338 338 339 339 // clean up inflight signup asynchronously 340 340 go func() {