all repos — honk @ 1dab6623e5cfb202c33a976d3dd63f6f89f6473a

my fork of honk

Add hydration (refresh) support to user pages
Peter Sanchez pjs@petersanchez.com
Wed, 27 Apr 2022 19:11:47 -0600
commit

1dab6623e5cfb202c33a976d3dd63f6f89f6473a

parent

7d553a86e910350664063b0865c465fe8b722a6c

2 files changed, 8 insertions(+), 0 deletions(-)

jump to
M views/honkpage.jsviews/honkpage.js

@@ -148,6 +148,8 @@ } else if (name == "combo") {

args["c"] = arg } else if (name == "honker") { args["xid"] = arg + } else if (name == "user") { + args["uname"] = arg } return args }
M web.goweb.go

@@ -712,6 +712,8 @@ }

u := login.GetUserInfo(r) honks := gethonksbyuser(name, u != nil && u.Username == name, 0) templinfo := getInfo(r) + templinfo["PageName"] = "user" + templinfo["PageArg"] = name templinfo["Name"] = user.Name templinfo["WhatAbout"] = user.HTAbout templinfo["ServerMessage"] = ""

@@ -2272,6 +2274,10 @@ <button tabindex=1 name="add honker" value="add honker">add honker</button>

</form>`, login.GetCSRF("submithonker", r), xid) msg := templates.Sprintf(`honks by honker: <a href="%s" ref="noreferrer">%s</a>%s`, xid, xid, miniform) hydra.Srvmsg = msg + case "user": + uname := r.FormValue("uname") + honks = gethonksbyuser(uname, u != nil && u.Username == uname, wanted) + hydra.Srvmsg = templates.Sprintf("honks by user: %s", uname) default: http.NotFound(w, r) }