From 01c38c5c21c1e723925b603039bf7e9c04844c2a Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Wed, 7 Aug 2024 22:15:47 -0700 Subject: [PATCH] Easy comment thread unsubscribe links in Notifications --- pkg/controller/comment/subscription.go | 2 +- web/static/css/theme.css | 10 ++++++++++ web/templates/account/dashboard.html | 26 +++++++++++++++++++------- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/pkg/controller/comment/subscription.go b/pkg/controller/comment/subscription.go index cb063ee..38d1ae2 100644 --- a/pkg/controller/comment/subscription.go +++ b/pkg/controller/comment/subscription.go @@ -81,7 +81,7 @@ func Subscription() http.HandlerFunc { if subscribe { session.Flash(w, r, "You will now be notified about comments on this page.") } else { - session.Flash(w, r, "You will no longer be notified about new comments on this page.") + session.Flash(w, r, "You will no longer be notified about new comments on that thread.") } } } diff --git a/web/static/css/theme.css b/web/static/css/theme.css index 521419d..0b251c0 100644 --- a/web/static/css/theme.css +++ b/web/static/css/theme.css @@ -208,4 +208,14 @@ img { .nonshy-htsignup { display: none; +} + +/* Dashboard notification page styles */ +.nonshy-notification-row { + position: relative; +} +.nonshy-notif-delete-button { + position: absolute; + top: 4px; + right: 4px; } \ No newline at end of file diff --git a/web/templates/account/dashboard.html b/web/templates/account/dashboard.html index 087bd50..99d3167 100644 --- a/web/templates/account/dashboard.html +++ b/web/templates/account/dashboard.html @@ -480,6 +480,14 @@ {{$Body := $Root.NotifMap.Get .ID}} + + +
{{if not .Read}} @@ -655,13 +663,17 @@ {{SincePrettyCoarse .CreatedAt}} ago. - - + + {{if or (eq .Type "also_posted") (eq .Type "also_comment")}} + + + Mute this thread + + + {{end}}