dashboard.tmpl 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. {{template "base/head" .}}
  2. <div class="dashboard feeds">
  3. {{template "user/dashboard/navbar" .}}
  4. <div class="ui container">
  5. <div class="ui grid">
  6. <div class="ten wide column">
  7. {{template "user/dashboard/feeds" .}}
  8. {{if .AfterID}}
  9. <button class="ui fluid basic button center ajax-load-button" data-url="{{.Link}}?after_id={{.AfterID}}">More</button>
  10. {{end}}
  11. </div>
  12. <div class="six wide column">
  13. <div class="ui {{if not .ContextUser.IsOrganization}}three{{else}}two{{end}} item tabable menu">
  14. <a class="item active" data-tab="repos">{{.i18n.Tr "repository"}}</a>
  15. {{if not .ContextUser.IsOrganization}}
  16. <a class="item" data-tab="orgs">{{.i18n.Tr "organization"}}</a>
  17. {{end}}
  18. <a class="item" data-tab="mirrors">{{.i18n.Tr "mirror"}}</a>
  19. </div>
  20. <div class="ui tab active list" data-tab="repos">
  21. <div class="ui top attached header">
  22. {{.i18n.Tr "home.my_repos"}} <span class="ui grey label">{{.RepoCount}}</span>
  23. <div class="ui right">
  24. <a class="poping up" href="{{AppSubURL}}/repo/create{{if .ContextUser.IsOrganization}}?org={{.ContextUser.ID}}{{end}}" data-content="{{.i18n.Tr "new_repo"}}" data-variation="tiny inverted" data-position="left center">
  25. <i class="plus icon"></i>
  26. <span class="sr-only">{{.i18n.Tr "new_repo"}}</span>
  27. </a>
  28. </div>
  29. </div>
  30. <div class="ui attached table segment">
  31. <ul class="repo-owner-name-list">
  32. {{range .Repos}}
  33. <li {{if .IsPrivate}}class="private"{{end}}>
  34. <a href="{{AppSubURL}}/{{$.ContextUser.Name}}/{{.Name}}">
  35. <i class="octicon octicon-{{if .IsFork}}repo-forked{{else if .IsPrivate}}lock{{else if .IsMirror}}repo-clone{{else}}repo{{end}}"></i>
  36. <strong class="text truncate item-name">{{.Name}}</strong>
  37. <span class="ui right text light grey">
  38. {{.NumStars}} <i class="octicon octicon-star rear"></i>
  39. </span>
  40. </a>
  41. </li>
  42. {{end}}
  43. {{if gt .ContextUser.NumRepos .MaxShowRepoNum}}
  44. <li>
  45. <a href="{{.ContextUser.HomeLink}}">{{.i18n.Tr "home.show_more_repos"}}</a>
  46. </li>
  47. {{end}}
  48. </ul>
  49. </div>
  50. {{if not .ContextUser.IsOrganization}}
  51. <h4 class="ui top attached header">
  52. {{.i18n.Tr "home.collaborative_repos"}}
  53. </h4>
  54. <div class="ui attached table segment">
  55. <ul id="collaborative-repo-list">
  56. {{range .CollaborativeRepos}}
  57. <li {{if .IsPrivate}}class="private"{{end}}>
  58. <a href="{{AppSubURL}}/{{.Owner.Name}}/{{.Name}}">
  59. <i class="octicon octicon-{{if .IsPrivate}}lock{{else if .IsFork}}repo-forked{{else if .IsMirror}}repo-clone{{else}}repo{{end}}"></i>
  60. <span class="text truncate owner-and-repo">
  61. <span class="text truncate owner-name">{{.Owner.Name}}</span> / <strong>{{.Name}}</strong>
  62. </span>
  63. <span class="ui right text light grey">
  64. {{.NumStars}} <i class="octicon octicon-star rear"></i>
  65. </span>
  66. </a>
  67. </li>
  68. {{end}}
  69. </ul>
  70. </div>
  71. {{end}}
  72. </div>
  73. {{if not .ContextUser.IsOrganization}}
  74. <div class="ui tab list" data-tab="orgs">
  75. <div class="ui top attached header">
  76. {{.i18n.Tr "home.my_orgs"}} <span class="ui grey label">{{.ContextUser.GetOrganizationCount}}</span>
  77. {{if .LoggedUser.CanCreateOrganization}}
  78. <div class="ui right">
  79. <a class="poping up" href="{{AppSubURL}}/org/create" data-content="{{.i18n.Tr "new_org"}}" data-variation="tiny inverted" data-position="left center">
  80. <i class="plus icon"></i>
  81. <span class="sr-only">{{.i18n.Tr "new_org"}}</span>
  82. </a>
  83. </div>
  84. {{end}}
  85. </div>
  86. <div class="ui attached table segment">
  87. <ul class="repo-owner-name-list">
  88. {{range .ContextUser.Orgs}}
  89. <li>
  90. <a href="{{AppSubURL}}/{{.Name}}">
  91. <i class="octicon octicon-organization"></i>
  92. <strong class="text truncate item-name">{{.Name}}</strong>
  93. <span class="ui right text light grey">
  94. {{.NumRepos}} <i class="octicon octicon-repo rear"></i>
  95. </span>
  96. </a>
  97. </li>
  98. {{end}}
  99. </ul>
  100. </div>
  101. </div>
  102. {{end}}
  103. <div class="ui tab list" data-tab="mirrors">
  104. <div class="ui top attached header">
  105. {{.i18n.Tr "home.my_mirrors"}} <span class="ui grey label">{{.MirrorCount}}</span>
  106. <div class="ui right">
  107. <a class="poping up" href="{{AppSubURL}}/repo/migrate?mirror=1{{if .ContextUser.IsOrganization}}&org={{.ContextUser.ID}}{{end}}" data-content="{{.i18n.Tr "new_mirror"}}" data-variation="tiny inverted" data-position="left center">
  108. <i class="plus icon"></i>
  109. <span class="sr-only">{{.i18n.Tr "new_mirror"}}</span>
  110. </a>
  111. </div>
  112. </div>
  113. <div class="ui attached table segment">
  114. <ul class="repo-owner-name-list">
  115. {{range .Mirrors}}
  116. <li {{if .IsPrivate}}class="private"{{end}}>
  117. <a href="{{AppSubURL}}/{{$.ContextUser.Name}}/{{.Name}}">
  118. <i class="octicon octicon-repo-clone"></i>
  119. <strong class="text truncate item-name">{{.Name}}</strong>
  120. <span class="ui right text light grey">
  121. {{.Interval}}H <i class="octicon octicon-sync rear"></i>
  122. </span>
  123. </a>
  124. </li>
  125. {{end}}
  126. </ul>
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. </div>
  133. {{template "base/footer" .}}