mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Update the list of watchers and stargazers when clicking watch/unwatch or star/unstar (#32570)
We make sure the user cards are updated - Fixes https://github.com/go-gitea/gitea/issues/32561 I also removed `ctx.Data["PageIsWatchers"] = true` and `ctx.Data["PageIsStargazers"] = true` as they are not used anywhere. # Before  # After  --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
@@ -1,4 +1,14 @@
|
||||
<div class="user-cards">
|
||||
<!-- Refresh the content if a htmx response contains "HX-Trigger" header.
|
||||
This usually happens when a user stays on the watchers/stargazers page
|
||||
when they watched/unwatched/starred/unstarred and the list should be refreshed.
|
||||
To test go to the watchers page and click the watch button. The user cards should reload.
|
||||
At the moment, no JS initialization would re-trigger (fortunately there is no JS for this page).
|
||||
-->
|
||||
<div class="no-loading-indicator tw-hidden"></div>
|
||||
<div class="user-cards"
|
||||
hx-trigger="refreshUserCards from:body" hx-indicator=".no-loading-indicator"
|
||||
hx-get="{{$.CurrentURL}}" hx-swap="outerHTML" hx-select=".user-cards"
|
||||
>
|
||||
{{if .CardsTitle}}
|
||||
<h2 class="ui dividing header">
|
||||
{{.CardsTitle}}
|
||||
|
Reference in New Issue
Block a user