Add hydration (refresh) support to user pages
This commit is contained in:
parent
6b333c62f3
commit
c0fc930e36
|
@ -148,6 +148,8 @@ function hydrargs() {
|
||||||
args["c"] = arg
|
args["c"] = arg
|
||||||
} else if (name == "honker") {
|
} else if (name == "honker") {
|
||||||
args["xid"] = arg
|
args["xid"] = arg
|
||||||
|
} else if (name == "user") {
|
||||||
|
args["uname"] = arg
|
||||||
}
|
}
|
||||||
return args
|
return args
|
||||||
}
|
}
|
||||||
|
|
6
web.go
6
web.go
|
@ -712,6 +712,8 @@ func showuser(w http.ResponseWriter, r *http.Request) {
|
||||||
u := login.GetUserInfo(r)
|
u := login.GetUserInfo(r)
|
||||||
honks := gethonksbyuser(name, u != nil && u.Username == name, 0)
|
honks := gethonksbyuser(name, u != nil && u.Username == name, 0)
|
||||||
templinfo := getInfo(r)
|
templinfo := getInfo(r)
|
||||||
|
templinfo["PageName"] = "user"
|
||||||
|
templinfo["PageArg"] = name
|
||||||
templinfo["Name"] = user.Name
|
templinfo["Name"] = user.Name
|
||||||
templinfo["WhatAbout"] = user.HTAbout
|
templinfo["WhatAbout"] = user.HTAbout
|
||||||
templinfo["ServerMessage"] = ""
|
templinfo["ServerMessage"] = ""
|
||||||
|
@ -2272,6 +2274,10 @@ func webhydra(w http.ResponseWriter, r *http.Request) {
|
||||||
</form>`, login.GetCSRF("submithonker", r), xid)
|
</form>`, login.GetCSRF("submithonker", r), xid)
|
||||||
msg := templates.Sprintf(`honks by honker: <a href="%s" ref="noreferrer">%s</a>%s`, xid, xid, miniform)
|
msg := templates.Sprintf(`honks by honker: <a href="%s" ref="noreferrer">%s</a>%s`, xid, xid, miniform)
|
||||||
hydra.Srvmsg = msg
|
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:
|
default:
|
||||||
http.NotFound(w, r)
|
http.NotFound(w, r)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue