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.

dashboard.tmpl 8.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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 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="/org/create"><i class="octicon octicon-organization"></i>{{.i18n.Tr "new_org"}}</a></li>
  62. </ul>
  63. </li>
  64. </ul>
  65. <div class="panel" id="dashboard-my-repo">
  66. <div class="panel-header">
  67. <h4 class="left">{{.i18n.Tr "home.my_repos"}}
  68. <span class="repo-count label label-gray label-radius">{{.ContextUser.NumRepos}}</span>
  69. </h4>
  70. &nbsp;
  71. </div>
  72. <div class="panel-body">
  73. <ul class="list-no-style">
  74. {{range .Repos}}
  75. <li {{if .IsPrivate}}class="private"{{end}}>
  76. <a href="/{{$.ContextUser.Name}}/{{.Name}}">
  77. <i class="octicon octicon-{{if .IsPrivate}}lock{{else if .IsFork}}repo-forked{{else if .IsMirror}}repo-clone{{else}}repo{{end}}"></i>
  78. <span class="repo-name">
  79. <strong class="repo">{{.Name}}</strong>
  80. </span>
  81. <span class="right repo-star">
  82. <i class="octicon octicon-star"></i>{{.NumStars}}
  83. </span>
  84. </a>
  85. </li>
  86. {{end}}
  87. </ul>
  88. </div>
  89. {{if not .ContextUser.IsOrganization}}
  90. <div class="panel-header repo-contrib-header">
  91. <h4 class="text-bold">{{.i18n.Tr "home.collaborative_repos"}}
  92. <span class="repo-count label label-gray label-radius">{{.CollaborateCount}}</span>
  93. </h4>
  94. </div>
  95. <div class="panel-body">
  96. <ul class="list-no-style">
  97. {{range .CollaborativeRepos}}
  98. <li {{if .IsPrivate}}class="private"{{end}}>
  99. <a href="{{.Owner.Name}}/{{.Name}}">
  100. <i class="octicon octicon-{{if .IsPrivate}}lock{{else if .IsFork}}repo-forked{{else if .IsMirror}}repo-clone{{else}}repo{{end}}"></i>
  101. <span class="repo-name">
  102. <span class="repo-name-prefix">{{.Owner.Name}} / </span>
  103. <strong class="repo">{{.Name}}</strong>
  104. </span>
  105. <span class="right repo-star">
  106. <i class="octicon octicon-star"></i>{{.NumStars}}
  107. </span>
  108. </a>
  109. </li>
  110. {{end}}
  111. </ul>
  112. </div>
  113. {{end}}
  114. </div>
  115. {{if not .ContextUser.IsOrganization}}
  116. <div class="panel" id="dashboard-my-org">
  117. <div class="panel-header">
  118. <h4 class="text-bold">{{.i18n.Tr "home.my_orgs"}}
  119. <span class="repo-count label label-gray label-radius">{{.ContextUser.GetOrganizationCount}}</span>
  120. </h4>
  121. </div>
  122. <div class="panel-body">
  123. <ul class="list-no-style">
  124. {{range .ContextUser.Orgs}}
  125. <li>
  126. <a href="/{{.Name}}">
  127. <i class="octicon octicon-organization"></i>
  128. <span class="repo-name">
  129. <strong class="repo">{{.Name}}</strong>
  130. </span>
  131. <span class="right repo-star">
  132. <i class="octicon octicon-repo"></i>{{.NumRepos}}
  133. </span>
  134. </a>
  135. </li>
  136. {{end}}
  137. </ul>
  138. </div>
  139. </div>
  140. {{end}}
  141. <div class="panel" id="dashboard-my-mirror">
  142. <div class="panel-header">
  143. <h4 class="text-bold">{{.i18n.Tr "home.my_mirrors"}}
  144. <span class="repo-count label label-gray label-radius">{{.MirrorCount}}</span>
  145. </h4>
  146. </div>
  147. <div class="panel-body">
  148. <ul class="list-no-style">
  149. {{range .Mirrors}}
  150. <li {{if .IsPrivate}}class="private"{{end}}>
  151. <a href="/{{$.ContextUser.Name}}/{{.Name}}">
  152. <i class="octicon octicon-repo-clone"></i>
  153. <span class="repo-name">
  154. <strong class="repo">{{.Name}}</strong>
  155. </span>
  156. <span class="right repo-star">
  157. <i class="octicon octicon-sync"></i>{{.Interval}}H
  158. </span>
  159. </a>
  160. </li>
  161. {{end}}
  162. </ul>
  163. </div>
  164. </div>
  165. </div>
  166. </div>
  167. </div>
  168. {{template "ng/base/footer" .}}