diff --git a/internal/handler/stats.go b/internal/handler/stats.go index 61a676e..9d3e2b7 100644 --- a/internal/handler/stats.go +++ b/internal/handler/stats.go @@ -55,6 +55,19 @@ func (h *StatsHandler) Render(w http.ResponseWriter, r *http.Request) { } } +// AcknowledgeFeedback handles the per-row "Acknowledge" form POST. Marks +// the row acknowledged (one-way) and emails the author that we've seen +// it and started work, then 303-redirects back to /stats. Already- +// acknowledged or unknown ids redirect silently. +func (h *StatsHandler) AcknowledgeFeedback(w http.ResponseWriter, r *http.Request) { + id := chi.URLParam(r, "id") + if err := h.svc.Acknowledge(r.Context(), id); err != nil && !errors.Is(err, service.ErrAlreadyAcknowledged) { + http.Error(w, "acknowledge failed: "+err.Error(), http.StatusInternalServerError) + return + } + http.Redirect(w, r, "/stats", http.StatusSeeOther) +} + // ResolveFeedback handles the per-row "Mark resolved" form POST. It marks // the row resolved (one-way) and fires the author thank-you email, then // 303-redirects back to /stats so a refresh doesn't re-submit. Already- @@ -99,10 +112,13 @@ h2 { font-size: 1.05rem; margin-top: 2rem; margin-bottom: 0.5rem; border-bottom: .fb .cat-pill { font-weight: 700; text-transform: capitalize; color: #1a1a1a } .fb .msg { white-space: pre-wrap; font-size: 0.95rem } .fb .author { font-size: 0.78rem; color: #888; margin-top: 0.5rem } -.fb .foot { display: flex; justify-content: flex-end; margin-top: 0.6rem } +.fb .foot { display: flex; justify-content: flex-end; align-items: center; gap: 0.6rem; margin-top: 0.6rem } .resolved-badge { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.78rem; font-weight: 600; color: #1e7a4a } +.acked-badge { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.78rem; font-weight: 600; color: #9a6b2f } .resolve-btn { font: inherit; font-size: 0.8rem; font-weight: 600; color: #fff; background: #1e7a4a; border: 0; border-radius: 6px; padding: 0.4rem 0.85rem; cursor: pointer } .resolve-btn:hover { background: #196b40 } +.ack-btn { font: inherit; font-size: 0.8rem; font-weight: 600; color: #9a6b2f; background: #fff; border: 1px solid #d6b27a; border-radius: 6px; padding: 0.4rem 0.85rem; cursor: pointer } +.ack-btn:hover { background: #faf5ea } code { background: #f4f4f4; padding: 0.05em 0.3em; border-radius: 3px; font-size: 0.85em } .empty { color: #888; font-style: italic } @@ -150,8 +166,16 @@ code { background: #f4f4f4; padding: 0.05em 0.3em; border-radius: 3px; font-size
Hare Kṛṣṇa{{if .Name}}, {{.Name}}{{end}} 🙏
+// admin marks their feedback resolved. Vaishnava-styled, short, and +// quotes back the exact feedback the devotee submitted so they know +// precisely what was addressed. Base font is 17px for comfortable +// reading on phones. +var feedbackResolvedEmailTpl = template.Must(template.New("feedbackResolved").Parse(`Hare Kṛṣṇa{{if .Name}}, {{.Name}}{{end}} 🙏
-Please accept our humble obeisances. All glories to Śrīla Prabhupāda.
+The feedback you shared with us has been addressed and the necessary + changes are now live:
-We are writing to let you know that the feedback you kindly shared with - us has been acknowledged and addressed. The necessary - features and fixes you pointed us toward have now been implemented.
+{{.Message}}-
Your observations help us serve Śrīla Prabhupāda's vāṇī more - faithfully, and we are sincerely grateful that you took the time to write. - Devotee feedback like yours is one of the ways this humble service keeps - improving.
- -We warmly invite you to continue using +
Thank you for helping us serve Śrīla Prabhupāda's vāṇī more + faithfully. Please continue using prabhupadasays.org - with even greater enthusiasm — there is always more of Śrīla Prabhupāda's - nectar waiting to be relished.
+ with even greater enthusiasm. -Your servants,
+
Your servants,
The Prabhupāda Says team
- “Books are the basis.” — His Divine Grace A.C. Bhaktivedanta Swami Prabhupāda -
Hare Kṛṣṇa{{if .Name}}, {{.Name}}{{end}} 🙏
+ +Thank you for the feedback you shared with us:
+ +{{.Message}}+ +
We acknowledge your feedback and have noted it carefully. If it calls + for a new feature or a fix, our dev team has already begun working on it. + You'll receive another email from us once it has been implemented or + resolved.
+ +Thank you for helping us serve Śrīla Prabhupāda's vāṇī more + faithfully. Please continue using + prabhupadasays.org + with even greater enthusiasm.
+ +Your servants,
+ The Prabhupāda Says team