From 037f71a9f5b19ed67d8c32d55ef7230d6f89c41a Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Fri, 20 Jun 2025 14:08:20 -0700 Subject: [PATCH] Profile Webhook: Support profile headlines (On PTO) --- docs/Webhooks.md | 3 +++ pkg/api.go | 1 + src/components/ProfileModal.vue | 15 +++++++++++++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/docs/Webhooks.md b/docs/Webhooks.md index c92ee89..7cf5498 100644 --- a/docs/Webhooks.md +++ b/docs/Webhooks.md @@ -71,6 +71,7 @@ The expected response from your endpoint should follow this format: "Data": { "OK": true, "Error": "any error messaging (omittable if no errors)", + "Headline": "Optional profile headline text", "ProfileFields": [ { "Name": "Age", @@ -85,3 +86,5 @@ The expected response from your endpoint should follow this format: } } ``` + +If the Headline field is provided from your site, it will be shown above the profile fields in a banner. \ No newline at end of file diff --git a/pkg/api.go b/pkg/api.go index b5a3c6f..48b2d76 100644 --- a/pkg/api.go +++ b/pkg/api.go @@ -764,6 +764,7 @@ func (s *Server) UserProfile() http.HandlerFunc { type result struct { OK bool Error string `json:",omitempty"` + Headline string `json:",omitempty"` ProfileFields []profileField `json:",omitempty"` } diff --git a/src/components/ProfileModal.vue b/src/components/ProfileModal.vue index a251c31..63f1b70 100644 --- a/src/components/ProfileModal.vue +++ b/src/components/ProfileModal.vue @@ -27,6 +27,7 @@ export default { busy: false, // Profile data + headline: "", profileFields: [], // Ban account data @@ -140,6 +141,8 @@ export default { return; } + this.headline = data.Headline ? data.Headline : ""; + if (data.ProfileFields != undefined) { this.profileFields = data.ProfileFields; } @@ -466,8 +469,16 @@ export default { + +
+
+ {{headline}} +
+
+
+ -
+
Online since: {{ onlineSince }} @@ -487,7 +498,7 @@ export default {
-
+
Loading profile details...