From a5a3c8141274bbcc12e5c4f72b85e02efe47841c Mon Sep 17 00:00:00 2001 From: Giteabot Date: Sun, 9 Jul 2023 15:15:00 -0400 Subject: [PATCH] Fix notification list bugs (#25781) (#25787) Backport #25781 by @wxiaoguang Fix #25627 1. `ctx.Data["Link"]` should use relative URL but not AppURL 2. The `data-params` is incorrect because it doesn't contain "page". JS can simply use "window.location.search" to construct the AJAX URL 3. The `data-xxx` and `id` in notification_subscriptions.tmpl were copied&pasted, they don't have affect. Co-authored-by: wxiaoguang --- routers/web/user/notification.go | 2 +- templates/user/notification/notification_div.tmpl | 2 +- templates/user/notification/notification_subscriptions.tmpl | 2 +- web_src/js/features/notification.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/routers/web/user/notification.go b/routers/web/user/notification.go index e0aa92879f..cae12f4126 100644 --- a/routers/web/user/notification.go +++ b/routers/web/user/notification.go @@ -186,7 +186,7 @@ func NotificationStatusPost(ctx *context.Context) { if ctx.Written() { return } - ctx.Data["Link"] = setting.AppURL + "notifications" + ctx.Data["Link"] = setting.AppSubURL + "/notifications" ctx.Data["SequenceNumber"] = ctx.Req.PostFormValue("sequence-number") ctx.HTML(http.StatusOK, tplNotificationDiv) diff --git a/templates/user/notification/notification_div.tmpl b/templates/user/notification/notification_div.tmpl index 0b46e43b4f..fb640581b6 100644 --- a/templates/user/notification/notification_div.tmpl +++ b/templates/user/notification/notification_div.tmpl @@ -1,4 +1,4 @@ -
+
{{$notificationUnreadCount := call .NotificationUnreadCount}}