gitea源码

user_cards.tmpl 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <!-- Refresh the content if a htmx response contains "HX-Trigger" header.
  2. This usually happens when a user stays on the watchers/stargazers page
  3. when they watched/unwatched/starred/unstarred and the list should be refreshed.
  4. To test go to the watchers page and click the watch button. The user cards should reload.
  5. At the moment, no JS initialization would re-trigger (fortunately there is no JS for this page).
  6. -->
  7. <div class="no-loading-indicator tw-hidden"></div>
  8. <div class="user-cards"
  9. hx-trigger="refreshUserCards from:body" hx-indicator=".no-loading-indicator"
  10. hx-get="{{$.CurrentURL}}" hx-swap="outerHTML" hx-select=".user-cards"
  11. >
  12. {{if .CardsTitle}}
  13. <h2 class="ui dividing header">
  14. {{.CardsTitle}}
  15. </h2>
  16. {{end}}
  17. <ul class="list">
  18. {{range .Cards}}
  19. <li class="item ui segment">
  20. <a href="{{.HomeLink}}">
  21. {{ctx.AvatarUtils.Avatar . 48}}
  22. </a>
  23. <h3 class="name"><a href="{{.HomeLink}}">{{.DisplayName}}</a></h3>
  24. <div class="meta">
  25. {{if .Website}}
  26. {{svg "octicon-link"}} <a href="{{.Website}}" target="_blank" rel="noopener noreferrer">{{.Website}}</a>
  27. {{else if .Location}}
  28. {{svg "octicon-location"}} {{.Location}}
  29. {{else}}
  30. {{svg "octicon-calendar"}} {{ctx.Locale.Tr "user.joined_on" (DateUtils.AbsoluteShort .CreatedUnix)}}
  31. {{end}}
  32. </div>
  33. </li>
  34. {{end}}
  35. </ul>
  36. {{template "base/paginate" .}}
  37. </div>