You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

profile_big_avatar.tmpl 5.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <div id="profile-avatar-card" class="ui card">
  2. <div id="profile-avatar" class="content tw-flex">
  3. {{if eq .SignedUserID .ContextUser.ID}}
  4. <a class="image" href="{{AppSubUrl}}/user/settings" data-tooltip-content="{{ctx.Locale.Tr "user.change_avatar"}}">
  5. {{/* the size doesn't take affect (and no need to take affect), image size(width) should be controlled by the parent container since this is not a flex layout*/}}
  6. {{ctx.AvatarUtils.Avatar .ContextUser 256}}
  7. </a>
  8. {{else}}
  9. <span class="image">
  10. {{ctx.AvatarUtils.Avatar .ContextUser 256}}
  11. </span>
  12. {{end}}
  13. </div>
  14. <div class="content gt-word-break profile-avatar-name">
  15. {{if .ContextUser.FullName}}<span class="header text center">{{.ContextUser.FullName}}</span>{{end}}
  16. <span class="username text center">{{.ContextUser.Name}} {{if .IsAdmin}}
  17. <a class="muted" href="{{AppSubUrl}}/admin/users/{{.ContextUser.ID}}" data-tooltip-content="{{ctx.Locale.Tr "admin.users.details"}}">
  18. {{svg "octicon-gear" 18}}
  19. </a>
  20. {{end}}</span>
  21. <div class="gt-mt-3">
  22. <a class="muted" href="{{.ContextUser.HomeLink}}?tab=followers">{{svg "octicon-person" 18 "gt-mr-2"}}{{.NumFollowers}} {{ctx.Locale.Tr "user.followers"}}</a> · <a class="muted" href="{{.ContextUser.HomeLink}}?tab=following">{{.NumFollowing}} {{ctx.Locale.Tr "user.following"}}</a>
  23. {{if .EnableFeed}}
  24. <a href="{{.ContextUser.HomeLink}}.rss"><i class="ui text grey gt-ml-3" data-tooltip-content="{{ctx.Locale.Tr "rss_feed"}}">{{svg "octicon-rss" 18}}</i></a>
  25. {{end}}
  26. </div>
  27. </div>
  28. <div class="extra content gt-word-break">
  29. <ul>
  30. {{if .UserBlocking}}
  31. <li class="text red">{{svg "octicon-circle-slash"}} {{ctx.Locale.Tr "user.block.blocked"}}</li>
  32. {{if .UserBlocking.Note}}
  33. <li class="text small red">{{ctx.Locale.Tr "user.block.note"}}: {{.UserBlocking.Note}}</li>
  34. {{end}}
  35. {{end}}
  36. {{if .ContextUser.Location}}
  37. <li>
  38. {{svg "octicon-location"}}
  39. <span class="tw-flex-1">{{.ContextUser.Location}}</span>
  40. {{if .ContextUserLocationMapURL}}
  41. <a href="{{.ContextUserLocationMapURL}}" rel="nofollow noreferrer" data-tooltip-content="{{ctx.Locale.Tr "user.show_on_map"}}">
  42. {{svg "octicon-link-external"}}
  43. </a>
  44. {{end}}
  45. </li>
  46. {{end}}
  47. {{if (eq .SignedUserID .ContextUser.ID)}}
  48. <li>
  49. {{svg "octicon-mail"}}
  50. <a class="tw-flex-1" href="mailto:{{.ContextUser.Email}}" rel="nofollow">{{.ContextUser.Email}}</a>
  51. <a href="{{AppSubUrl}}/user/settings#privacy-user-settings">
  52. {{if .ShowUserEmail}}
  53. <i data-tooltip-content="{{ctx.Locale.Tr "user.email_visibility.limited"}}">
  54. {{svg "octicon-unlock"}}
  55. </i>
  56. {{else}}
  57. <i data-tooltip-content="{{ctx.Locale.Tr "user.email_visibility.private"}}">
  58. {{svg "octicon-lock"}}
  59. </i>
  60. {{end}}
  61. </a>
  62. </li>
  63. {{else}}
  64. {{if .ShowUserEmail}}
  65. <li>
  66. {{svg "octicon-mail"}}
  67. <a href="mailto:{{.ContextUser.Email}}" rel="nofollow">{{.ContextUser.Email}}</a>
  68. </li>
  69. {{end}}
  70. {{end}}
  71. {{if .ContextUser.Website}}
  72. <li>
  73. {{svg "octicon-link"}}
  74. <a target="_blank" rel="noopener noreferrer me" href="{{.ContextUser.Website}}">{{.ContextUser.Website}}</a>
  75. </li>
  76. {{end}}
  77. {{if $.RenderedDescription}}
  78. <li>
  79. <div class="render-content markup">{{$.RenderedDescription}}</div>
  80. </li>
  81. {{end}}
  82. {{range .OpenIDs}}
  83. {{if .Show}}
  84. <li>
  85. {{svg "fontawesome-openid"}}
  86. <a target="_blank" rel="noopener noreferrer" href="{{.URI}}">{{.URI}}</a>
  87. </li>
  88. {{end}}
  89. {{end}}
  90. <li>{{svg "octicon-calendar"}} <span>{{ctx.Locale.Tr "user.joined_on" (DateTime "short" .ContextUser.CreatedUnix)}}</span></li>
  91. {{if and .Orgs .HasOrgsVisible}}
  92. <li>
  93. <ul class="user-orgs">
  94. {{range .Orgs}}
  95. {{if (or .Visibility.IsPublic (and ($.SignedUser) (or .Visibility.IsLimited (and (.HasMemberWithUserID ctx $.SignedUserID) .Visibility.IsPrivate) ($.IsAdmin))))}}
  96. <li>
  97. <a href="{{.HomeLink}}" data-tooltip-content="{{.Name}}">
  98. {{ctx.AvatarUtils.Avatar .}}
  99. </a>
  100. </li>
  101. {{end}}
  102. {{end}}
  103. </ul>
  104. </li>
  105. {{end}}
  106. {{if .Badges}}
  107. <li>
  108. <ul class="user-badges">
  109. {{range .Badges}}
  110. <li>
  111. <img width="64" height="64" src="{{.ImageURL}}" alt="{{.Description}}" data-tooltip-content="{{.Description}}">
  112. </li>
  113. {{end}}
  114. </ul>
  115. </li>
  116. {{end}}
  117. {{if and .IsSigned (ne .SignedUserID .ContextUser.ID)}}
  118. {{if not .UserBlocking}}
  119. <li class="follow" hx-target="#profile-avatar-card" hx-indicator="#profile-avatar-card">
  120. {{if $.IsFollowing}}
  121. <button hx-post="{{.ContextUser.HomeLink}}?action=unfollow" class="ui basic red button">
  122. {{svg "octicon-person"}} {{ctx.Locale.Tr "user.unfollow"}}
  123. </button>
  124. {{else}}
  125. <button hx-post="{{.ContextUser.HomeLink}}?action=follow" class="ui basic primary button">
  126. {{svg "octicon-person"}} {{ctx.Locale.Tr "user.follow"}}
  127. </button>
  128. {{end}}
  129. </li>
  130. {{end}}
  131. <li>
  132. {{if not .UserBlocking}}
  133. <a class="muted show-modal" href="#" data-modal="#block-user-modal" data-modal-modal-blockee="{{.ContextUser.Name}}" data-modal-modal-blockee-name="{{.ContextUser.GetDisplayName}}" data-modal-modal-form.action="{{AppSubUrl}}/user/settings/blocked_users">{{ctx.Locale.Tr "user.block.block.user"}}</a>
  134. {{else}}
  135. <a class="muted" href="{{AppSubUrl}}/user/settings/blocked_users">{{ctx.Locale.Tr "user.block.unblock"}}</a>
  136. {{end}}
  137. </li>
  138. {{end}}
  139. </ul>
  140. </div>
  141. </div>
  142. {{template "shared/user/block_user_dialog" .}}