mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-21 08:31:27 -05:00
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 <wxiaoguang@gmail.com>
This commit is contained in:
parent
ea2c9de3c4
commit
a5a3c81412
4 changed files with 4 additions and 4 deletions
|
@ -186,7 +186,7 @@ func NotificationStatusPost(ctx *context.Context) {
|
||||||
if ctx.Written() {
|
if ctx.Written() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ctx.Data["Link"] = setting.AppURL + "notifications"
|
ctx.Data["Link"] = setting.AppSubURL + "/notifications"
|
||||||
ctx.Data["SequenceNumber"] = ctx.Req.PostFormValue("sequence-number")
|
ctx.Data["SequenceNumber"] = ctx.Req.PostFormValue("sequence-number")
|
||||||
|
|
||||||
ctx.HTML(http.StatusOK, tplNotificationDiv)
|
ctx.HTML(http.StatusOK, tplNotificationDiv)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<div role="main" aria-label="{{.Title}}" class="page-content user notification" id="notification_div" data-params="{{.Page.GetParams}}" data-sequence-number="{{.SequenceNumber}}">
|
<div role="main" aria-label="{{.Title}}" class="page-content user notification" id="notification_div" data-sequence-number="{{.SequenceNumber}}">
|
||||||
<div class="ui container">
|
<div class="ui container">
|
||||||
{{$notificationUnreadCount := call .NotificationUnreadCount}}
|
{{$notificationUnreadCount := call .NotificationUnreadCount}}
|
||||||
<div class="gt-df gt-ac gt-sb gt-mb-4">
|
<div class="gt-df gt-ac gt-sb gt-mb-4">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{{template "base/head" .}}
|
{{template "base/head" .}}
|
||||||
<div role="main" aria-label="{{.Title}}" class="page-content user notification" id="notification_subscriptions" data-params="{{.Page.GetParams}}" data-sequence-number="{{.SequenceNumber}}">
|
<div role="main" aria-label="{{.Title}}" class="page-content user notification">
|
||||||
<div class="ui container">
|
<div class="ui container">
|
||||||
<div class="ui top attached tabular menu">
|
<div class="ui top attached tabular menu">
|
||||||
<a href="{{AppSubUrl}}/notifications/subscriptions" class="{{if eq .Status 1}}active {{end}}item">
|
<a href="{{AppSubUrl}}/notifications/subscriptions" class="{{if eq .Status 1}}active {{end}}item">
|
||||||
|
|
|
@ -165,7 +165,7 @@ async function updateNotificationTable() {
|
||||||
if (notificationDiv.length > 0) {
|
if (notificationDiv.length > 0) {
|
||||||
const data = await $.ajax({
|
const data = await $.ajax({
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: `${appSubUrl}/notifications?${notificationDiv.data('params')}`,
|
url: `${appSubUrl}/notifications${window.location.search}`,
|
||||||
data: {
|
data: {
|
||||||
'div-only': true,
|
'div-only': true,
|
||||||
'sequence-number': ++notificationSequenceNumber,
|
'sequence-number': ++notificationSequenceNumber,
|
||||||
|
|
Loading…
Reference in a new issue