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.tmpl 6.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. {{template "base/head" .}}
  2. <div role="main" aria-label="{{.Title}}" class="page-content user profile">
  3. <div class="ui container">
  4. <div class="ui stackable grid">
  5. <div class="ui five wide column">
  6. <div class="ui card">
  7. <div id="profile-avatar" class="content gt-df">
  8. {{if eq .SignedUserID .ContextUser.ID}}
  9. <a class="image" href="{{AppSubUrl}}/user/settings" data-tooltip-content="{{.locale.Tr "user.change_avatar"}}">
  10. {{/* 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*/}}
  11. {{avatar $.Context .ContextUser 256}}
  12. </a>
  13. {{else}}
  14. <span class="image">
  15. {{avatar $.Context .ContextUser 256}}
  16. </span>
  17. {{end}}
  18. </div>
  19. <div class="content gt-word-break profile-avatar-name">
  20. {{if .ContextUser.FullName}}<span class="header text center">{{.ContextUser.FullName}}</span>{{end}}
  21. <span class="username text center">{{.ContextUser.Name}}</span>
  22. {{if .EnableFeed}}
  23. <a href="{{.ContextUser.HomeLink}}.rss"><i class="ui text grey gt-ml-3" data-tooltip-content="{{.locale.Tr "rss_feed"}}">{{svg "octicon-rss" 18}}</i></a>
  24. {{end}}
  25. <div class="gt-mt-3">
  26. <a class="muted" href="{{.ContextUser.HomeLink}}?tab=followers">{{svg "octicon-person" 18 "gt-mr-2"}}{{.NumFollowers}} {{.locale.Tr "user.followers"}}</a> · <a class="muted" href="{{.ContextUser.HomeLink}}?tab=following">{{.NumFollowing}} {{.locale.Tr "user.following"}}</a>
  27. </div>
  28. </div>
  29. <div class="extra content gt-word-break">
  30. <ul>
  31. {{if .ContextUser.Location}}
  32. <li>{{svg "octicon-location"}} {{.ContextUser.Location}}</li>
  33. {{end}}
  34. {{if (eq .SignedUserID .ContextUser.ID)}}
  35. <li>
  36. {{svg "octicon-mail"}}
  37. <a href="mailto:{{.ContextUser.Email}}" rel="nofollow">{{.ContextUser.Email}}</a>
  38. <a href="{{AppSubUrl}}/user/settings#keep-email-private">
  39. {{if .ShowUserEmail}}
  40. <i class="ui right" data-tooltip-content="{{.locale.Tr "user.email_visibility.limited"}}">
  41. {{svg "octicon-unlock"}}
  42. </i>
  43. {{else}}
  44. <i class="ui right" data-tooltip-content="{{.locale.Tr "user.email_visibility.private"}}">
  45. {{svg "octicon-lock"}}
  46. </i>
  47. {{end}}
  48. </a>
  49. </li>
  50. {{else}}
  51. {{if .ShowUserEmail}}
  52. <li>
  53. {{svg "octicon-mail"}}
  54. <a href="mailto:{{.ContextUser.Email}}" rel="nofollow">{{.ContextUser.Email}}</a>
  55. </li>
  56. {{end}}
  57. {{end}}
  58. {{if .ContextUser.Website}}
  59. <li>
  60. {{svg "octicon-link"}}
  61. <a target="_blank" rel="noopener noreferrer me" href="{{.ContextUser.Website}}">{{.ContextUser.Website}}</a>
  62. </li>
  63. {{end}}
  64. {{if $.RenderedDescription}}
  65. <li>
  66. <div class="render-content markup">{{$.RenderedDescription|Str2html}}</div>
  67. </li>
  68. {{end}}
  69. {{range .OpenIDs}}
  70. {{if .Show}}
  71. <li>
  72. {{svg "fontawesome-openid"}}
  73. <a target="_blank" rel="noopener noreferrer" href="{{.URI}}">{{.URI}}</a>
  74. </li>
  75. {{end}}
  76. {{end}}
  77. <li>{{svg "octicon-clock"}} {{.locale.Tr "user.joined_on" (DateTime "short" .ContextUser.CreatedUnix) | Safe}}</li>
  78. {{if and .Orgs .HasOrgsVisible}}
  79. <li>
  80. <ul class="user-orgs">
  81. {{range .Orgs}}
  82. {{if (or .Visibility.IsPublic (and ($.SignedUser) (or .Visibility.IsLimited (and (.HasMemberWithUserID $.SignedUserID) .Visibility.IsPrivate) ($.IsAdmin))))}}
  83. <li>
  84. <a href="{{.HomeLink}}" data-tooltip-content="{{.Name}}">
  85. {{avatar $.Context .}}
  86. </a>
  87. </li>
  88. {{end}}
  89. {{end}}
  90. </ul>
  91. </li>
  92. {{end}}
  93. {{if .Badges}}
  94. <li>
  95. <ul class="user-badges">
  96. {{range .Badges}}
  97. <li>
  98. <img width="64" height="64" src="{{.ImageURL}}" alt="{{.Description}}" data-tooltip-content="{{.Description}}">
  99. </li>
  100. {{end}}
  101. </ul>
  102. </li>
  103. {{end}}
  104. {{if and .IsSigned (ne .SignedUserID .ContextUser.ID)}}
  105. <li class="follow">
  106. {{if $.IsFollowing}}
  107. <form method="post" action="{{.Link}}?action=unfollow&redirect_to={{$.Link}}">
  108. {{$.CsrfTokenHtml}}
  109. <button type="submit" class="ui basic red button">{{svg "octicon-person"}} {{.locale.Tr "user.unfollow"}}</button>
  110. </form>
  111. {{else}}
  112. <form method="post" action="{{.Link}}?action=follow&redirect_to={{$.Link}}">
  113. {{$.CsrfTokenHtml}}
  114. <button type="submit" class="ui basic green button">{{svg "octicon-person"}} {{.locale.Tr "user.follow"}}</button>
  115. </form>
  116. {{end}}
  117. </li>
  118. {{end}}
  119. </ul>
  120. </div>
  121. </div>
  122. </div>
  123. <div class="ui eleven wide column">
  124. <div class="ui secondary stackable pointing tight menu">
  125. {{template "user/overview/header" .}}
  126. </div>
  127. {{if eq .TabName "activity"}}
  128. {{if .ContextUser.KeepActivityPrivate}}
  129. <div class="ui info message">
  130. <p>{{.locale.Tr "user.disabled_public_activity"}}</p>
  131. </div>
  132. {{end}}
  133. {{template "user/heatmap" .}}
  134. <div class="feeds">
  135. {{template "user/dashboard/feeds" .}}
  136. </div>
  137. {{else if eq .TabName "stars"}}
  138. <div class="stars">
  139. {{template "explore/repo_search" .}}
  140. {{template "explore/repo_list" .}}
  141. {{template "base/paginate" .}}
  142. </div>
  143. {{else if eq .TabName "following"}}
  144. {{template "repo/user_cards" .}}
  145. {{else if eq .TabName "followers"}}
  146. {{template "repo/user_cards" .}}
  147. {{else if or (eq .TabName "repositories") (not .ProfileReadme)}}
  148. {{template "explore/repo_search" .}}
  149. {{template "explore/repo_list" .}}
  150. {{template "base/paginate" .}}
  151. {{else if .ProfileReadme}}
  152. <div id="readme_profile" class="render-content markup"> {{$.ProfileReadme|Str2html}} </div>
  153. {{end}}
  154. </div>
  155. </div>
  156. </div>
  157. </div>
  158. {{template "base/footer" .}}