-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Update the list of watchers and stargazers when clicking watch/unwatch or star/unstar #32570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
c621f9a
bb88042
4f633ca
1c81461
92bc292
da86679
f00c491
09aac88
b1aa34a
ae207c0
61c882c
ab2843b
8f073fa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,18 @@ | ||
{{template "base/head" .}} | ||
<div role="main" aria-label="{{.Title}}" class="page-content repository watchers"> | ||
{{template "repo/header" .}} | ||
<div class="ui container"> | ||
<div class="no-loading-indicator tw-hidden"></div> | ||
<!-- this element reloads its content with htmx as soon as a response from the backend | ||
includes the header "HX-Trigger: refreshCards". This usually happens when a user | ||
watched/unwatched/starred/unstarred and we want their user card to appear/disappear. | ||
To test go to the watchers page and click the watch button. The user cards should reload. --> | ||
<div | ||
hx-trigger="refreshCards from:body" | ||
wxiaoguang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
hx-indicator=".no-loading-indicator" | ||
hx-swap="innerHTML" | ||
hx-get="{{$.Link}}/cards" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems that it could use hx-select to partially reloading, then no need to add these There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i will try it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just pushed 🤣 Managed to get it work in da86679, only a few changed lines now There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One more thing, it should use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah that looks great and the diff is smaller, thank you. |
||
class="ui container" | ||
> | ||
{{template "repo/user_cards" .}} | ||
</div> | ||
</div> | ||
|
Uh oh!
There was an error while loading. Please reload this page.