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.

112 lines
4.5 KiB

  1. {{template "base/head" .}}
  2. <div class="dashboard feeds">
  3. {{template "user/dashboard/navbar" .}}
  4. <div class="ui container">
  5. {{template "base/alert" .}}
  6. <div class="ui grid">
  7. <div class="ten wide column">
  8. {{template "user/dashboard/feeds" .}}
  9. </div>
  10. <div id="dashboard-repo-search" class="six wide column">
  11. <div class="ui {{if not .ContextUser.IsOrganization}}three{{else}}two{{end}} item stackable tabable menu">
  12. <a :class="{item: true, active: tab === 'repos'}" @click="changeTab('repos')">{{.i18n.Tr "repository"}}</a>
  13. {{if not .ContextUser.IsOrganization}}
  14. <a :class="{item: true, active: tab === 'orgs'}" @click="changeTab('orgs')">{{.i18n.Tr "organization"}}</a>
  15. {{end}}
  16. <a :class="{item: true, active: tab === 'mirrors'}" @click="changeTab('mirrors')">{{.i18n.Tr "mirror"}}</a>
  17. </div>
  18. <div v-if="tab === 'repos'" class="ui tab active list">
  19. <div class="ui fluid input">
  20. <input @keyUp="searchKeyUp" v-model="searchQuery" id="search_repo" placeholder="{{.i18n.Tr "home.search_repos"}}">
  21. </div>
  22. <h4 class="ui top attached header">
  23. {{.i18n.Tr "home.my_repos"}} <span class="ui grey label">{{.ContextUser.NumRepos}}</span>
  24. <div class="ui right">
  25. <a class="poping up" href="{{AppSubUrl}}/repo/create" data-content="{{.i18n.Tr "new_repo"}}" data-variation="tiny inverted" data-position="left center">
  26. <i class="plus icon"></i>
  27. <span class="sr-only">{{.i18n.Tr "new_repo"}}</span>
  28. </a>
  29. </div>
  30. </h4>
  31. <div class="ui attached table segment">
  32. <ul class="repo-owner-name-list">
  33. <li v-for="repo in repos" :class="{'private': repo.private}">
  34. <a :href="'{{AppSubUrl}}/' + repo.full_name">
  35. <i :class="repoClass(repo)"></i>
  36. <strong class="text truncate item-name"><% repo.full_name %></strong>
  37. <span class="ui right text light grey">
  38. <% repo.stars_count %> <i class="octicon octicon-star rear"></i>
  39. </span>
  40. </a>
  41. </li>
  42. {{if gt .ContextUser.NumRepos .MaxShowRepoNum}}
  43. <li>
  44. <a href="{{.ContextUser.HomeLink}}">{{.i18n.Tr "home.show_more_repos"}}</a>
  45. </li>
  46. {{end}}
  47. </ul>
  48. </div>
  49. </div>
  50. {{if not .ContextUser.IsOrganization}}
  51. <div v-if="tab === 'orgs'" class="ui tab active list">
  52. <h4 class="ui top attached header">
  53. {{.i18n.Tr "home.my_orgs"}} <span class="ui grey label">{{.ContextUser.GetOrganizationCount}}</span>
  54. <div class="ui right">
  55. {{if .SignedUser.CanCreateOrganization}}
  56. <a class="poping up" href="{{AppSubUrl}}/org/create" data-content="{{.i18n.Tr "new_org"}}" data-variation="tiny inverted" data-position="left center">
  57. <i class="plus icon"></i>
  58. <span class="sr-only">{{.i18n.Tr "new_org"}}</span>
  59. </a>
  60. {{end}}
  61. </div>
  62. </h4>
  63. <div class="ui attached table segment">
  64. <ul class="repo-owner-name-list">
  65. {{range .ContextUser.Orgs}}
  66. <li>
  67. <a href="{{AppSubUrl}}/{{.Name}}">
  68. <i class="octicon octicon-organization"></i>
  69. <strong class="text truncate item-name">{{.Name}}</strong>
  70. <span class="ui right text light grey">
  71. {{.NumRepos}} <i class="octicon octicon-repo rear"></i>
  72. </span>
  73. </a>
  74. </li>
  75. {{end}}
  76. </ul>
  77. </div>
  78. </div>
  79. {{end}}
  80. <div v-if="tab === 'mirrors'" class="ui tab active list">
  81. <h4 class="ui top attached header">
  82. {{.i18n.Tr "home.my_mirrors"}} <span class="ui grey label">{{.MirrorCount}}</span>
  83. <div class="ui right">
  84. <a class="poping up" href="{{AppSubUrl}}/repo/migrate?mirror=1" data-content="{{.i18n.Tr "new_mirror"}}" data-variation="tiny inverted" data-position="left center">
  85. <i class="plus icon"></i>
  86. <span class="sr-only">{{.i18n.Tr "new_mirror"}}</span>
  87. </a>
  88. </div>
  89. </h4>
  90. <div class="ui attached table segment">
  91. <ul class="repo-owner-name-list">
  92. {{range .Mirrors}}
  93. <li {{if .IsPrivate}}class="private"{{end}}>
  94. <a href="{{AppSubUrl}}/{{$.ContextUser.Name}}/{{.Name}}">
  95. <i class="octicon octicon-repo-clone"></i>
  96. <strong class="text truncate item-name">{{.Name}}</strong>
  97. <span class="ui right text light grey">
  98. {{.Interval}}H <i class="octicon octicon-sync rear"></i>
  99. </span>
  100. </a>
  101. </li>
  102. {{end}}
  103. </ul>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. {{template "base/footer" .}}