|
73 | 73 | {{$.CsrfTokenHtml}} |
74 | 74 | <input type="hidden" name="notification_id" value="{{.ID}}"> |
75 | 75 | <input type="hidden" name="status" value="pinned"> |
76 | | - <button class="btn interact-bg tw-p-2" title="{{ctx.Locale.Tr "notification.pin"}}" |
77 | | - data-url="{{AppSubUrl}}/notifications/status" |
78 | | - data-status="pinned" |
79 | | - data-page="{{$.Page.Paginater.Current}}" |
80 | | - data-notification-id="{{.ID}}" |
81 | | - data-q="{{$.Keyword}}"> |
| 76 | + <button type="button" class="btn interact-bg tw-p-2" title="{{ctx.Locale.Tr "notification.pin"}}" |
| 77 | + hx-post="{{AppSubUrl}}/notifications/status" |
| 78 | + hx-target="#notification_div" |
| 79 | + hx-swap="outerHTML" |
| 80 | + hx-vals='{"notification_id": "{{.ID}}", "status": "pinned", "page": "{{$.Page.Paginater.Current}}", "_csrf": "{{$.CsrfToken}}"}' |
| 81 | + {{if eq .Status 3}}disabled{{end}} |
| 82 | + > |
82 | 83 | {{svg "octicon-pin"}} |
83 | 84 | </button> |
84 | 85 | </form> |
|
89 | 90 | <input type="hidden" name="notification_id" value="{{.ID}}"> |
90 | 91 | <input type="hidden" name="status" value="read"> |
91 | 92 | <input type="hidden" name="page" value="{{$.Page.Paginater.Current}}"> |
92 | | - <button class="btn interact-bg tw-p-2" title="{{ctx.Locale.Tr "notification.mark_as_read"}}" |
93 | | - data-url="{{AppSubUrl}}/notifications/status" |
94 | | - data-status="read" |
95 | | - data-page="{{$.Page.Paginater.Current}}" |
96 | | - data-notification-id="{{.ID}}" |
97 | | - data-q="{{$.Keyword}}"> |
| 93 | + <button type="button" class="btn interact-bg tw-p-2" title="{{ctx.Locale.Tr "notification.mark_as_read"}}" |
| 94 | + hx-post="{{AppSubUrl}}/notifications/status" |
| 95 | + hx-target="#notification_div" |
| 96 | + hx-swap="outerHTML" |
| 97 | + hx-vals='{"notification_id": "{{.ID}}", "status": "read", "page": "{{$.Page.Paginater.Current}}", "_csrf": "{{$.CsrfToken}}"}' |
| 98 | + > |
98 | 99 | {{svg "octicon-check"}} |
99 | 100 | </button> |
100 | 101 | </form> |
|
104 | 105 | <input type="hidden" name="notification_id" value="{{.ID}}"> |
105 | 106 | <input type="hidden" name="status" value="unread"> |
106 | 107 | <input type="hidden" name="page" value="{{$.Page.Paginater.Current}}"> |
107 | | - <button class="btn interact-bg tw-p-2" title="{{ctx.Locale.Tr "notification.mark_as_unread"}}" |
108 | | - data-url="{{AppSubUrl}}/notifications/status" |
109 | | - data-status="unread" |
110 | | - data-page="{{$.Page.Paginater.Current}}" |
111 | | - data-notification-id="{{.ID}}" |
112 | | - data-q="{{$.Keyword}}"> |
| 108 | + <button type="button" class="btn interact-bg tw-p-2" title="{{ctx.Locale.Tr "notification.mark_as_unread"}}" |
| 109 | + hx-post="{{AppSubUrl}}/notifications/status" |
| 110 | + hx-target="#notification_div" |
| 111 | + hx-swap="outerHTML" |
| 112 | + hx-vals='{"notification_id": "{{.ID}}", "status": "unread", "page": "{{$.Page.Paginater.Current}}", "_csrf": "{{$.CsrfToken}}"}' |
| 113 | + > |
113 | 114 | {{svg "octicon-bell"}} |
114 | 115 | </button> |
115 | 116 | </form> |
|
0 commit comments