dashboard.tmpl 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. {{template "ng/base/head" .}}
  2. {{template "ng/base/header" .}}
  3. {{template "user/dashboard/nav" .}}
  4. <div id="dashboard-wrapper">
  5. <div id="dashboard" class="container">
  6. <div id="dashboard-news" class="left grid-2-3">
  7. {{range .Feeds}}
  8. <div class="news clear">
  9. <div class="avatar left">
  10. <img class="avatar-30" src="{{AvatarLink .GetActEmail}}" alt="">
  11. </div>
  12. <div class="content left {{if eq .GetOpType 5}}push-news{{end}}">
  13. <p class="text-bold">
  14. <a href="/{{.GetActUserName}}">{{.GetActUserName}}</a>
  15. {{if eq .GetOpType 1}}
  16. {{$.i18n.Tr "action.create_repo" .GetRepoLink .GetRepoLink | Str2html}}
  17. {{else if eq .GetOpType 5}}
  18. {{$.i18n.Tr "action.commit_repo" .GetRepoLink .GetBranch .GetBranch .GetRepoLink .GetRepoLink | Str2html}}
  19. {{else if eq .GetOpType 6}}
  20. {{ $index := index .GetIssueInfos 0}}
  21. {{$.i18n.Tr "action.create_issue" .GetRepoLink $index .GetRepoLink $index | Str2html}}
  22. {{else if eq .GetOpType 10}}
  23. {{ $index := index .GetIssueInfos 0}}
  24. {{$.i18n.Tr "action.comment_issue" .GetRepoLink $index .GetRepoLink $index | Str2html}}
  25. {{end}}
  26. </p>
  27. {{if eq .GetOpType 5}}
  28. <div class="news-content content">
  29. <ul class="list-no-style">
  30. {{ $push := ActionContent2Commits .}}
  31. {{ $repoLink := .GetRepoLink}}
  32. {{range $push.Commits}}
  33. <li><img class="avatar-16" src="{{AvatarLink .AuthorEmail}}?s=16"> <a href="/{{$repoLink}}/commit/{{.Sha1}}">{{ShortSha .Sha1}}</a> {{.Message}}</li>
  34. {{end}}
  35. </ul>
  36. </div>
  37. {{else if eq .GetOpType 6}}
  38. <p class="news-content comment-news">{{index .GetIssueInfos 1}}</p>
  39. {{else if eq .GetOpType 10}}
  40. <p class="news-content comment-news">{{index .GetIssueInfos 1}}</p>
  41. {{end}}
  42. <p class="news-time text-italic">{{TimeSince .GetCreate $.i18n.Lang}}</p>
  43. </div>
  44. <i class="mega-octicon octicon-{{ActionIcon .GetOpType}} right"></i>
  45. </div>
  46. {{end}}
  47. </div>
  48. <div id="dashboard-sidebar" class="right grid-1-3">
  49. <ul id="dashboard-sidebar-menu" class="menu menu-line">
  50. <li class="js-tab-nav js-tab-nav-show first" data-tab-target="#dashboard-my-repo"><a href="#">{{.i18n.Tr "repository"}}</a></li>
  51. {{if not .ContextUser.IsOrganization}}
  52. <li class="js-tab-nav" data-tab-target="#dashboard-my-org"><a href="#">{{.i18n.Tr "organization"}}</a></li>
  53. {{end}}
  54. <li class="js-tab-nav last" data-tab-target="#dashboard-my-mirror"><a href="#">{{.i18n.Tr "mirror"}}</a></li>
  55. <li class="drop right">
  56. <button class="btn btn-green text-bold" id="dashboard-new-repo">
  57. <i class="octicon octicon-plus"></i>
  58. </button>
  59. <ul class="menu menu-vertical drop-down" id="dashboard-new-repo-menu">
  60. <li><a href="/repo/create"><i class="octicon octicon-repo-create"></i>{{.i18n.Tr "new_repo"}}</a></li>
  61. <li><a href="/repo/migrate"><i class="octicon octicon-repo-clone"></i>{{.i18n.Tr "new_migrate"}}</a></li>
  62. <li><a href="/org/create"><i class="octicon octicon-organization"></i>{{.i18n.Tr "new_org"}}</a></li>
  63. </ul>
  64. </li>
  65. </ul>
  66. <div class="panel" id="dashboard-my-repo">
  67. <div class="panel-header">
  68. <h4 class="left">{{.i18n.Tr "home.my_repos"}}
  69. <span class="repo-count label label-gray label-radius">{{.ContextUser.NumRepos}}</span>
  70. </h4>
  71. &nbsp;
  72. </div>
  73. <div class="panel-body">
  74. <ul class="list-no-style">
  75. {{range .Repos}}
  76. <li {{if .IsPrivate}}class="private"{{end}}>
  77. <a href="/{{$.ContextUser.Name}}/{{.Name}}">
  78. <i class="octicon octicon-{{if .IsPrivate}}lock{{else if .IsFork}}repo-forked{{else if .IsMirror}}repo-clone{{else}}repo{{end}}"></i>
  79. <span class="repo-name">
  80. <strong class="repo">{{.Name}}</strong>
  81. </span>
  82. <span class="right repo-star">
  83. <i class="octicon octicon-star"></i>{{.NumStars}}
  84. </span>
  85. </a>
  86. </li>
  87. {{end}}
  88. </ul>
  89. </div>
  90. {{if not .ContextUser.IsOrganization}}
  91. <div class="panel-header repo-contrib-header">
  92. <h4 class="text-bold">{{.i18n.Tr "home.collaborative_repos"}}
  93. <span class="repo-count label label-gray label-radius">{{.CollaborateCount}}</span>
  94. </h4>
  95. </div>
  96. <div class="panel-body">
  97. <ul class="list-no-style">
  98. {{range .CollaborativeRepos}}
  99. <li {{if .IsPrivate}}class="private"{{end}}>
  100. <a href="{{.Owner.Name}}/{{.Name}}">
  101. <i class="octicon octicon-{{if .IsPrivate}}lock{{else if .IsFork}}repo-forked{{else if .IsMirror}}repo-clone{{else}}repo{{end}}"></i>
  102. <span class="repo-name">
  103. <span class="repo-name-prefix">{{.Owner.Name}} / </span>
  104. <strong class="repo">{{.Name}}</strong>
  105. </span>
  106. <span class="right repo-star">
  107. <i class="octicon octicon-star"></i>{{.NumStars}}
  108. </span>
  109. </a>
  110. </li>
  111. {{end}}
  112. </ul>
  113. </div>
  114. {{end}}
  115. </div>
  116. {{if not .ContextUser.IsOrganization}}
  117. <div class="panel" id="dashboard-my-org">
  118. <div class="panel-header">
  119. <h4 class="text-bold">{{.i18n.Tr "home.my_orgs"}}
  120. <span class="repo-count label label-gray label-radius">{{.ContextUser.GetOrganizationCount}}</span>
  121. </h4>
  122. </div>
  123. <div class="panel-body">
  124. <ul class="list-no-style">
  125. {{range .ContextUser.Orgs}}
  126. <li>
  127. <a href="/{{.Name}}">
  128. <i class="octicon octicon-organization"></i>
  129. <span class="repo-name">
  130. <strong class="repo">{{.Name}}</strong>
  131. </span>
  132. <span class="right repo-star">
  133. <i class="octicon octicon-repo"></i>{{.NumRepos}}
  134. </span>
  135. </a>
  136. </li>
  137. {{end}}
  138. </ul>
  139. </div>
  140. </div>
  141. {{end}}
  142. <div class="panel" id="dashboard-my-mirror">
  143. <div class="panel-header">
  144. <h4 class="text-bold">{{.i18n.Tr "home.my_mirrors"}}
  145. <span class="repo-count label label-gray label-radius">{{.MirrorCount}}</span>
  146. </h4>
  147. </div>
  148. <div class="panel-body">
  149. <ul class="list-no-style">
  150. {{range .Mirrors}}
  151. <li {{if .IsPrivate}}class="private"{{end}}>
  152. <a href="/{{$.ContextUser.Name}}/{{.Name}}">
  153. <i class="octicon octicon-repo-clone"></i>
  154. <span class="repo-name">
  155. <strong class="repo">{{.Name}}</strong>
  156. </span>
  157. <span class="right repo-star">
  158. <i class="octicon octicon-sync"></i>{{.Interval}}H
  159. </span>
  160. </a>
  161. </li>
  162. {{end}}
  163. </ul>
  164. </div>
  165. </div>
  166. </div>
  167. </div>
  168. </div>
  169. {{template "ng/base/footer" .}}