2024-11-23 02:51:51 +08:00
|
|
|
<!-- 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"
|
|
|
|
>
|
2020-02-10 04:18:01 +08:00
|
|
|
{{if .CardsTitle}}
|
2015-12-21 20:24:11 +08:00
|
|
|
<h2 class="ui dividing header">
|
|
|
|
{{.CardsTitle}}
|
|
|
|
</h2>
|
2020-02-10 04:18:01 +08:00
|
|
|
{{end}}
|
2015-12-21 20:24:11 +08:00
|
|
|
<ul class="list">
|
|
|
|
{{range .Cards}}
|
|
|
|
<li class="item ui segment">
|
|
|
|
<a href="{{.HomeLink}}">
|
2024-06-29 05:29:15 +08:00
|
|
|
{{ctx.AvatarUtils.Avatar . 48}}
|
2015-12-21 20:24:11 +08:00
|
|
|
</a>
|
|
|
|
<h3 class="name"><a href="{{.HomeLink}}">{{.DisplayName}}</a></h3>
|
|
|
|
|
|
|
|
<div class="meta">
|
|
|
|
{{if .Website}}
|
2020-09-12 04:19:00 +08:00
|
|
|
{{svg "octicon-link"}} <a href="{{.Website}}" target="_blank" rel="noopener noreferrer">{{.Website}}</a>
|
2015-12-21 20:24:11 +08:00
|
|
|
{{else if .Location}}
|
2020-09-12 04:19:00 +08:00
|
|
|
{{svg "octicon-location"}} {{.Location}}
|
2015-12-21 20:24:11 +08:00
|
|
|
{{else}}
|
2024-11-04 19:30:00 +08:00
|
|
|
{{svg "octicon-calendar"}} {{ctx.Locale.Tr "user.joined_on" (DateUtils.AbsoluteShort .CreatedUnix)}}
|
2015-12-21 20:24:11 +08:00
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
{{end}}
|
|
|
|
</ul>
|
|
|
|
|
2022-08-26 05:55:52 +08:00
|
|
|
{{template "base/paginate" .}}
|
2016-07-24 01:08:22 +08:00
|
|
|
</div>
|