|
69 | 69 | </div> |
70 | 70 | <div class="notifications-buttons tw-items-center tw-justify-end tw-gap-1 tw-px-1"> |
71 | 71 | {{if ne .Status 3}} |
72 | | - <form action="{{AppSubUrl}}/notifications/status" method="post"> |
73 | | - {{$.CsrfTokenHtml}} |
74 | | - <input type="hidden" name="notification_id" value="{{.ID}}"> |
75 | | - <input type="hidden" name="status" value="pinned"> |
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 | | - > |
83 | | - {{svg "octicon-pin"}} |
84 | | - </button> |
85 | | - </form> |
| 72 | + <button type="button" class="btn interact-bg tw-p-2" title="{{ctx.Locale.Tr "notification.pin"}}" |
| 73 | + hx-post="{{AppSubUrl}}/notifications/status" |
| 74 | + hx-target="#notification_div" |
| 75 | + hx-swap="outerHTML" |
| 76 | + hx-vals='{"notification_id": "{{.ID}}", "status": "pinned", "page": "{{$.Page.Paginater.Current}}", "_csrf": "{{$.CsrfToken}}", "noredirect": "true" }' |
| 77 | + {{if eq .Status 3}}disabled{{end}} |
| 78 | + > |
| 79 | + {{svg "octicon-pin"}} |
| 80 | + </button> |
86 | 81 | {{end}} |
87 | 82 | {{if or (eq .Status 1) (eq .Status 3)}} |
88 | | - <form action="{{AppSubUrl}}/notifications/status" method="post"> |
89 | | - {{$.CsrfTokenHtml}} |
90 | | - <input type="hidden" name="notification_id" value="{{.ID}}"> |
91 | | - <input type="hidden" name="status" value="read"> |
92 | | - <input type="hidden" name="page" value="{{$.Page.Paginater.Current}}"> |
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 | | - > |
99 | | - {{svg "octicon-check"}} |
100 | | - </button> |
101 | | - </form> |
| 83 | + <button type="button" class="btn interact-bg tw-p-2" title="{{ctx.Locale.Tr "notification.mark_as_read"}}" |
| 84 | + hx-post="{{AppSubUrl}}/notifications/status" |
| 85 | + hx-target="#notification_div" |
| 86 | + hx-swap="outerHTML" |
| 87 | + hx-vals='{"notification_id": "{{.ID}}", "status": "read", "page": "{{$.Page.Paginater.Current}}", "_csrf": "{{$.CsrfToken}}", "noredirect": "true"}' |
| 88 | + > |
| 89 | + {{svg "octicon-check"}} 123 |
| 90 | + </button> |
102 | 91 | {{else if eq .Status 2}} |
103 | | - <form action="{{AppSubUrl}}/notifications/status" method="post"> |
104 | | - {{$.CsrfTokenHtml}} |
105 | | - <input type="hidden" name="notification_id" value="{{.ID}}"> |
106 | | - <input type="hidden" name="status" value="unread"> |
107 | | - <input type="hidden" name="page" value="{{$.Page.Paginater.Current}}"> |
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 | | - > |
114 | | - {{svg "octicon-bell"}} |
115 | | - </button> |
116 | | - </form> |
| 92 | + <button type="button" class="btn interact-bg tw-p-2" title="{{ctx.Locale.Tr "notification.mark_as_unread"}}" |
| 93 | + hx-post="{{AppSubUrl}}/notifications/status" |
| 94 | + hx-target="#notification_div" |
| 95 | + hx-swap="outerHTML" |
| 96 | + hx-vals='{"notification_id": "{{.ID}}", "status": "unread", "page": "{{$.Page.Paginater.Current}}", "_csrf": "{{$.CsrfToken}}", "noredirect": "true"}' |
| 97 | + > |
| 98 | + {{svg "octicon-bell"}} |
| 99 | + </button> |
117 | 100 | {{end}} |
118 | 101 | </div> |
119 | 102 | </div> |
|
0 commit comments