feat: public profile page + richer hover card with "See full profile"
- New /users/{id} page renders a user's full profile from the card endpoint:
avatar, roles, full bio, contact (location/phone), links and custom detail
fields (internal extra keys hidden; link schemes sanitized).
- The hover user-card now shows a longer bio, phone, up to 3 links, and a
"See full profile →" button linking to /users/{id}.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -263,6 +263,14 @@ func (s *Server) routesWeb(mux *http.ServeMux) {
|
||||
})
|
||||
}))
|
||||
|
||||
mux.HandleFunc("GET /users/{id}", s.page(func(w http.ResponseWriter, r *http.Request, u *domain.User) {
|
||||
s.render(w, r, "public-profile.html", &pageData{
|
||||
Title: "Profile", User: u,
|
||||
Scripts: []string{"/static/js/public-profile.js"},
|
||||
Data: map[string]any{"UserID": r.PathValue("id")},
|
||||
})
|
||||
}))
|
||||
|
||||
rolePage("/messages", "messages.html", "Messages", "messages", "/static/js/messages.js", nil)
|
||||
rolePage("/metrics", "metrics.html", "Metrics", "metrics", "/static/js/metrics.js", nil)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user