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 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. {{template "base/head" .}}
  2. <div 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. {{if eq .SignedUserName .Owner.Name}}
  8. <a class="image poping up" href="{{AppSubUrl}}/user/settings" id="profile-avatar" data-content="{{.i18n.Tr "user.change_avatar"}}" data-variation="inverted tiny" data-position="bottom center">
  9. {{avatar .Owner 290}}
  10. </a>
  11. {{else}}
  12. <span class="image" id="profile-avatar">
  13. {{avatar .Owner 290}}
  14. </span>
  15. {{end}}
  16. <div class="content word-break profile-avatar-name">
  17. {{if .Owner.FullName}}<span class="header text center">{{.Owner.FullName}}</span>{{end}}
  18. <span class="username text center">{{.Owner.Name}}</span>
  19. </div>
  20. <div class="extra content word-break">
  21. <ul>
  22. {{if .Owner.Location}}
  23. <li>{{svg "octicon-location"}} {{.Owner.Location}}</li>
  24. {{end}}
  25. {{if .ShowUserEmail }}
  26. <li>
  27. {{svg "octicon-mail"}}
  28. <a href="mailto:{{.Owner.Email}}" rel="nofollow">{{.Owner.Email}}</a>
  29. </li>
  30. {{end}}
  31. {{if .Owner.Website}}
  32. <li>
  33. {{svg "octicon-link"}}
  34. <a target="_blank" rel="noopener noreferrer me" href="{{.Owner.Website}}">{{.Owner.Website}}</a>
  35. </li>
  36. {{end}}
  37. {{if $.RenderedDescription}}
  38. <li>
  39. <div class="render-content markdown">{{$.RenderedDescription|Str2html}}</div>
  40. </li>
  41. {{end}}
  42. {{range .OpenIDs}}
  43. {{if .Show}}
  44. <li>
  45. <i class="fa fa-openid"></i>
  46. <a target="_blank" rel="noopener noreferrer" href="{{.URI}}">{{.URI}}</a>
  47. </li>
  48. {{end}}
  49. {{end}}
  50. <li>{{svg "octicon-clock"}} {{.i18n.Tr "user.join_on"}} {{.Owner.CreatedUnix.FormatShort}}</li>
  51. {{if and .Orgs .HasOrgsVisible}}
  52. <li>
  53. <ul class="user-orgs">
  54. {{range .Orgs}}
  55. {{if (or .Visibility.IsPublic (and ($.SignedUser) (or .Visibility.IsLimited (and (.HasMemberWithUserID $.SignedUserID) .Visibility.IsPrivate) ($.IsAdmin))))}}
  56. <li>
  57. <a class="poping up" href="{{.HomeLink}}" data-content="{{.Name}}" data-position="top center" data-variation="tiny inverted">
  58. {{avatar .}}
  59. </a>
  60. </li>
  61. {{end}}
  62. {{end}}
  63. </ul>
  64. </li>
  65. {{end}}
  66. {{if and .IsSigned (ne .SignedUserName .Owner.Name)}}
  67. <li class="follow">
  68. {{if .SignedUser.IsFollowing .Owner.ID}}
  69. <form method="post" action="{{.Link}}/action/unfollow?redirect_to={{$.Link}}">
  70. {{$.CsrfTokenHtml}}
  71. <button type="submit" class="ui basic red button">{{svg "octicon-person"}} {{.i18n.Tr "user.unfollow"}}</button>
  72. </form>
  73. {{else}}
  74. <form method="post" action="{{.Link}}/action/follow?redirect_to={{$.Link}}">
  75. {{$.CsrfTokenHtml}}
  76. <button type="submit" class="ui basic green button">{{svg "octicon-person"}} {{.i18n.Tr "user.follow"}}</button>
  77. </form>
  78. {{end}}
  79. </li>
  80. {{end}}
  81. </ul>
  82. </div>
  83. </div>
  84. </div>
  85. <div class="ui eleven wide column">
  86. <div class="ui secondary stackable pointing tight menu">
  87. <a class='{{if and (ne .TabName "activity") (ne .TabName "following") (ne .TabName "followers") (ne .TabName "stars") (ne .TabName "projects")}}active{{end}} item' href="{{.Owner.HomeLink}}">
  88. {{svg "octicon-repo"}} {{.i18n.Tr "user.repositories"}}
  89. </a>
  90. <a class='{{if eq .TabName "activity"}}active{{end}} item' href="{{.Owner.HomeLink}}?tab=activity">
  91. {{svg "octicon-rss"}} {{.i18n.Tr "user.activity"}}
  92. </a>
  93. <a class='{{if eq .TabName "stars"}}active{{end}} item' href="{{.Owner.HomeLink}}?tab=stars">
  94. {{svg "octicon-star"}} {{.i18n.Tr "user.starred"}}
  95. <div class="ui label">{{.Owner.NumStars}}</div>
  96. </a>
  97. <a class='{{if eq .TabName "following"}}active{{end}} item' href="{{.Owner.HomeLink}}?tab=following">
  98. {{svg "octicon-person"}} {{.i18n.Tr "user.following"}}
  99. <div class="ui label">{{.Owner.NumFollowing}}</div>
  100. </a>
  101. <a class='{{if eq .TabName "followers"}}active{{end}} item' href="{{.Owner.HomeLink}}?tab=followers">
  102. {{svg "octicon-person"}} {{.i18n.Tr "user.followers"}}
  103. <div class="ui label">{{.Owner.NumFollowers}}</div>
  104. </a>
  105. </div>
  106. {{if eq .TabName "activity"}}
  107. {{if .Owner.KeepActivityPrivate}}
  108. <div class="ui info message">
  109. <p>{{.i18n.Tr "user.disabled_public_activity"}}</p>
  110. </div>
  111. {{end}}
  112. {{template "user/heatmap" .}}
  113. <div class="feeds">
  114. {{template "user/dashboard/feeds" .}}
  115. </div>
  116. {{else if eq .TabName "stars"}}
  117. <div class="stars">
  118. {{template "explore/repo_search" .}}
  119. {{template "explore/repo_list" .}}
  120. {{template "base/paginate" .}}
  121. </div>
  122. {{else if eq .TabName "following"}}
  123. {{template "repo/user_cards" .}}
  124. {{else if eq .TabName "followers"}}
  125. {{template "repo/user_cards" .}}
  126. {{else}}
  127. {{template "explore/repo_search" .}}
  128. {{template "explore/repo_list" .}}
  129. {{template "base/paginate" .}}
  130. {{end}}
  131. </div>
  132. </div>
  133. </div>
  134. </div>
  135. {{template "base/footer" .}}